Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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-SMF
Commits
fa99d43f
Commit
fa99d43f
authored
Nov 09, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for UPF selection - change priority order FQDN/IP addr
parent
9c712993
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
26 deletions
+30
-26
build/scripts/build_helper
build/scripts/build_helper
+3
-0
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+27
-26
No files found.
build/scripts/build_helper
View file @
fa99d43f
...
...
@@ -133,6 +133,9 @@ check_supported_distribution() {
"rhel8.2") return 0 ;;
"rhel8.3") return 0 ;;
"rhel8.4") return 0 ;;
"rhel8.5") return 0 ;;
"rhel8.6") return 0 ;;
"rhel8.7") return 0 ;;
#"centos7") return 0 ;;
esac
return 1
...
...
src/smf_app/smf_app.cpp
View file @
fa99d43f
...
...
@@ -1323,32 +1323,8 @@ bool smf_app::handle_nf_status_notification(
std
::
vector
<
struct
in_addr
>
ipv4_addrs
=
{};
profile
.
get
()
->
get_nf_ipv4_addresses
(
ipv4_addrs
);
// Use IPv4 addr first if available
if
(
ipv4_addrs
.
size
()
>=
1
)
{
bool
found
=
false
;
for
(
auto
node
:
smf_cfg
.
upfs
)
{
if
(
node
.
u1
.
ipv4_address
.
s_addr
==
ipv4_addrs
[
0
].
s_addr
)
{
found
=
true
;
break
;
}
}
if
(
!
found
)
{
// Add a new UPF node
Logger
::
smf_app
().
debug
(
"Add a new UPF node, Ipv4 Addr %s"
,
inet_ntoa
(
ipv4_addrs
[
0
]));
pfcp
::
node_id_t
n
=
{};
n
.
node_id_type
=
pfcp
::
NODE_ID_TYPE_IPV4_ADDRESS
;
n
.
u1
.
ipv4_address
.
s_addr
=
ipv4_addrs
[
0
].
s_addr
;
smf_cfg
.
upfs
.
push_back
(
n
);
upf_profile
*
upf_node_profile
=
dynamic_cast
<
upf_profile
*>
(
profile
.
get
());
start_upf_association
(
n
,
std
::
ref
(
*
upf_node_profile
));
}
else
{
Logger
::
smf_app
().
debug
(
"UPF node already exist (%s)"
,
inet_ntoa
(
ipv4_addrs
[
0
]));
}
}
else
if
(
!
upf_fqdn
.
empty
())
{
// use FQDN
// Use FQDN if available
if
(
!
upf_fqdn
.
empty
())
{
uint8_t
addr_type
=
{
0
};
std
::
string
address
=
{};
uint32_t
upf_port
=
{
0
};
...
...
@@ -1394,6 +1370,31 @@ bool smf_app::handle_nf_status_notification(
Logger
::
smf_app
().
debug
(
"UPF node already exist (%s)"
,
address
.
c_str
());
}
}
else
if
(
ipv4_addrs
.
size
()
>=
1
)
{
// If FQDN isn't available, check
// IP address
bool
found
=
false
;
for
(
auto
node
:
smf_cfg
.
upfs
)
{
if
(
node
.
u1
.
ipv4_address
.
s_addr
==
ipv4_addrs
[
0
].
s_addr
)
{
found
=
true
;
break
;
}
}
if
(
!
found
)
{
// Add a new UPF node
Logger
::
smf_app
().
debug
(
"Add a new UPF node, Ipv4 Addr %s"
,
inet_ntoa
(
ipv4_addrs
[
0
]));
pfcp
::
node_id_t
n
=
{};
n
.
node_id_type
=
pfcp
::
NODE_ID_TYPE_IPV4_ADDRESS
;
n
.
u1
.
ipv4_address
.
s_addr
=
ipv4_addrs
[
0
].
s_addr
;
smf_cfg
.
upfs
.
push_back
(
n
);
upf_profile
*
upf_node_profile
=
dynamic_cast
<
upf_profile
*>
(
profile
.
get
());
start_upf_association
(
n
,
std
::
ref
(
*
upf_node_profile
));
}
else
{
Logger
::
smf_app
().
debug
(
"UPF node already exist (%s)"
,
inet_ntoa
(
ipv4_addrs
[
0
]));
}
}
else
{
Logger
::
smf_app
().
debug
(
"No IP Addr/FQDN found"
);
return
false
;
...
...
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