Commit cf84406b authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix issue for retrieving Session Management Subscription from UDM

parent 86379c99
......@@ -944,8 +944,8 @@ bool smf_sbi::get_sm_data(
for (nlohmann::json::iterator it = jsonData["dnnConfigurations"].begin();
it != jsonData["dnnConfigurations"].end(); ++it) {
Logger::smf_sbi().debug("DNN %s", it.key().c_str());
if (it.key().compare(dnn) != 0) break;
if (it.key().compare(dnn) == 0) {
// Get DNN configuration
try {
std::shared_ptr<dnn_configuration_t> dnn_configuration =
std::make_shared<dnn_configuration_t>();
......@@ -959,7 +959,8 @@ bool smf_sbi::get_sm_data(
pdu_session_type;
// SSC_Mode (Mandatory)
std::string default_ssc_mode = it.value()["sscModes"]["defaultSscMode"];
std::string default_ssc_mode =
it.value()["sscModes"]["defaultSscMode"];
Logger::smf_sbi().debug(
"Default SSC Mode %s", default_ssc_mode.c_str());
ssc_mode_t ssc_mode(default_ssc_mode);
......@@ -1014,8 +1015,8 @@ bool smf_sbi::get_sm_data(
std::string ue_ip_str = ip_addr["ipv6Addr"].get<std::string>();
if (inet_pton(
AF_INET6, util::trim(ue_ip_str).c_str(), buf_in6_addr) ==
1) {
AF_INET6, util::trim(ue_ip_str).c_str(),
buf_in6_addr) == 1) {
memcpy(&ue_ipv6_addr, buf_in6_addr, sizeof(struct in6_addr));
} else {
Logger::smf_app().error(
......@@ -1029,7 +1030,8 @@ bool smf_sbi::get_sm_data(
} else if (ip_addr.find("ipv6Prefix") != ip_addr.end()) {
unsigned char buf_in6_addr[sizeof(struct in6_addr)];
struct in6_addr ipv6_prefix;
std::string prefix_str = ip_addr["ipv6Prefix"].get<std::string>();
std::string prefix_str =
ip_addr["ipv6Prefix"].get<std::string>();
std::vector<std::string> words = {};
boost::split(
words, prefix_str, boost::is_any_of("/"),
......@@ -1071,6 +1073,7 @@ bool smf_sbi::get_sm_data(
return false;
}
}
}
return true;
} else {
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