Commit a84cacc0 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'http_port_temp_fix' into 'develop'

hardcode http2 port for fqdn case

See merge request oai/cn5g/oai-cn5g-smf!118
parents 2b79bfb1 8ac363ee
......@@ -573,7 +573,12 @@ int smf_config::load(const string& config_file) {
IPV4_STR_ADDR_TO_INADDR(
util::trim(address).c_str(), amf_ipv4_addr,
"BAD IPv4 ADDRESS FORMAT FOR AMF !");
amf_addr.ipv4_addr = amf_ipv4_addr;
amf_addr.ipv4_addr = amf_ipv4_addr;
// We hardcode amf port from config for the moment
if (!(amf_cfg.lookupValue(SMF_CONFIG_STRING_AMF_PORT, amf_port))) {
Logger::smf_app().error(SMF_CONFIG_STRING_AMF_PORT "failed");
throw(SMF_CONFIG_STRING_AMF_PORT "failed");
}
amf_addr.port = amf_port;
amf_addr.api_version = "v1"; // TODO: to get API version from DNS
amf_addr.fqdn = astring;
......
......@@ -1597,6 +1597,9 @@ void smf_context::handle_pdu_session_create_sm_context_request(
boost::split(split_result, amf_status_uri, boost::is_any_of("/"));
if (split_result.size() >= 3) {
std::string addr = split_result[2];
// remove http port from the URI if existed
std::size_t found_port = addr.find(":");
if (found_port != std::string::npos) addr = addr.substr(0, found_port);
struct in_addr amf_ipv4_addr;
if (inet_aton(util::trim(addr).c_str(), &amf_ipv4_addr) == 0) {
Logger::smf_api_server().warn("Bad IPv4 for AMF");
......
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