Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UPF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UPF
Commits
d93251fa
Commit
d93251fa
authored
Mar 18, 2021
by
wangyongshou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify error of config interfce state/ip, ip route
parent
f922788c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
44 deletions
+48
-44
src/vppe/src/plugins/upf/upf_api.c
src/vppe/src/plugins/upf/upf_api.c
+9
-6
src/vppe/src/vlib/unix/main.c
src/vppe/src/vlib/unix/main.c
+39
-38
No files found.
src/vppe/src/plugins/upf/upf_api.c
View file @
d93251fa
...
...
@@ -80,6 +80,7 @@ void upf_create_gtpu_tunnel(const u32 n3_local_ip, const u32 n3_remote_ip, const
{
u8
*
buf
=
NULL
;
char
cmd
[
UPF_BUF
]
=
{
0
}
;
char
n3_local
[
UPF_BUF
]
=
{
0
};
char
n3_remote
[
UPF_BUF
]
=
{
0
};
vlib_main_t
*
vm
=
&
vlib_global_main
;
...
...
@@ -87,15 +88,16 @@ void upf_create_gtpu_tunnel(const u32 n3_local_ip, const u32 n3_remote_ip, const
upf_ip4_to_str
(
n3_local_ip
,
n3_local
,
UPF_BUF
);
upf_ip4_to_str
(
n3_remote_ip
,
n3_remote
,
UPF_BUF
);
char
cmd
[
UPF_BUF
]
=
{
0
}
;
snprintf
(
cmd
,
UPF_BUF
,
GTPU_TUNNEL
,
n3_local
,
n3_remote
,
teid
);
int
len
=
snprintf
(
cmd
,
UPF_BUF
,
GTPU_TUNNEL
,
n3_local
,
n3_remote
,
teid
);
unformat_input_t
sub_input
;
vec_resize
(
buf
,
UPF_BUF
);
//vec_copy(buf, cmd)
;
unformat_input_t
sub_input
;
vec_resize
(
buf
,
strlen
(
cmd
));
strncpy
((
char
*
)
buf
,
cmd
,
strlen
(
cmd
));
clib_upf_debug
(
um
->
log_fd
,
"len:%u, strlen:%u"
,
len
,
strlen
(
cmd
));
clib_upf_debug
(
um
->
log_fd
,
"
\n\n
***** Startup Config *****
\n\n
%s
\n
***** End Startup Config *****
\n\n
"
,
cmd
);
if
(
vec_len
(
buf
))
...
...
@@ -123,7 +125,8 @@ void upf_create_ip_route(const u32 ue_ip, const char *gtpu_name)
snprintf
(
cmd
,
UPF_BUF
,
IP_ROUTE
,
ueaddr
,
gtpu_name
);
unformat_input_t
sub_input
;
vec_resize
(
buf
,
UPF_BUF
);
vec_resize
(
buf
,
strlen
(
cmd
));
strncpy
((
char
*
)
buf
,
cmd
,
strlen
(
cmd
));
clib_upf_debug
(
um
->
log_fd
,
"
\n\n
***** Startup Config *****
\n\n
%s
\n
***** End Startup Config *****
\n\n
"
,
cmd
);
...
...
src/vppe/src/vlib/unix/main.c
View file @
d93251fa
...
...
@@ -390,14 +390,14 @@ startup_config_process (vlib_main_t * vm,
strcat
(
if_cmd
,
IF_UP_IPADDR
);
strcat
(
if_cmd
,
"ip route add 0.0.0.0/0 via %s %s
\n\n
"
);
vec_resize
(
buf
,
BUF_LEN
);
snprintf
(
cmd
,
BUF_LEN
,
if_cmd
,
if_info
->
if_n3
.
name
,
if_info
->
if_n3
.
name
,
if_info
->
if_n3
.
ipaddr
,
if_info
->
if_n3
.
netmask
,
if_info
->
if_n6
.
name
,
if_info
->
if_n6
.
name
,
if_info
->
if_n6
.
ipaddr
,
if_info
->
if_n6
.
netmask
,
if_info
->
if_n6
.
name
,
if_info
->
if_n6
.
gateway
);
vec_copy
(
buf
,
cmd
);
vec_resize
(
buf
,
strlen
(
cmd
));
strncpy
((
char
*
)
buf
,
cmd
,
strlen
(
cmd
));
clib_upf_debug
(
um
->
log_fd
,
"
\n\n
***** Startup Config *****
\n\n
%s
\n
***** End Startup Config *****
\n\n
"
,
cmd
);
...
...
@@ -413,6 +413,7 @@ startup_config_process (vlib_main_t * vm,
}
}
}
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment