Commit bfae8523 authored by kharade's avatar kharade

Merge branch 'develop' of https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-smf into assoc_retry

parents d7bf4cd8 c0de6f28
......@@ -51,8 +51,8 @@ SMF =
# first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF
DNN_LIST = (
# PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6}
{DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "12.1.1.2 - 12.1.1.128"; IPV6_PREFIX = "2001:1:2::/64"},
{DNN_NI = "oai.ipv4"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "12.2.1.1 - 12.2.1.128"; IPV6_PREFIX = "3001:1:2::/64"},
{DNN_NI = "oai.ipv4"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "12.1.1.2 - 12.1.1.128"; IPV6_PREFIX = "2001:1:2::/64"},
{DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "12.2.1.2 - 12.2.1.128"; IPV6_PREFIX = "3001:1:2::/64"},
{DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "12.1.1.129 - 12.1.1.224"; IPV6_PREFIX = "4001:1:2::/64"},
{DNN_NI = "ims"; PDU_SESSION_TYPE = "IPv4v6"; IPV4_RANGE = "12.2.1.129 - 12.2.1.224"; IPV6_PREFIX = "5001:1:2::/64"}
);
......
......@@ -1151,8 +1151,23 @@ bool smf_config::get_nwi_list_index(
return false;
}
if (node_id.node_id_type == pfcp::NODE_ID_TYPE_FQDN) {
// Resove FQDN here because, node id type is always IPV4_ADDRESS in
// upf_nwi_list
unsigned char buf_in_addr[sizeof(struct in_addr) + 1];
unsigned int upf_port = {0};
uint8_t addr_type = {0};
std::string address = {};
struct in_addr ipv4_Address;
fqdn::resolve(node_id.fqdn, address, upf_port, addr_type, "");
if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) == 1) {
memcpy(&ipv4_Address, buf_in_addr, sizeof(struct in_addr));
} else {
Logger::smf_app().error("FQDN resolve failed for get_nwi_list_index");
}
for (int i = 0; i < upf_nwi_list.size(); i++) {
if (node_id.fqdn == upf_nwi_list[i].upf_id.fqdn) {
if (ipv4_Address.s_addr ==
upf_nwi_list[i].upf_id.u1.ipv4_address.s_addr) {
nwi_list_index = i;
nwi_enabled = true;
return true;
......@@ -1161,7 +1176,7 @@ bool smf_config::get_nwi_list_index(
nwi_enabled = false;
return false;
}
return true;
return false;
}
//------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment