Commit 02960d61 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for UPF selection (w/wo NRF)/remove local_configuration

parent 682223fb
......@@ -687,7 +687,6 @@ int smf_config::load(const string& config_file) {
// Local configuration
num_session_management_subscription = 0;
const Setting& local_cfg = smf_cfg[SMF_CONFIG_STRING_LOCAL_CONFIGURATION];
string local_configuration_str = {};
const Setting& session_management_subscription_list_cfg =
local_cfg[SMF_CONFIG_STRING_SESSION_MANAGEMENT_SUBSCRIPTION_LIST];
......@@ -918,7 +917,7 @@ void smf_config::display() {
Logger::smf_app().info(
" Push PCO (DNS+MTU).........: %s", force_push_pco ? "Yes" : "No");
if (local_configuration) {
if (use_local_subscription_info) {
Logger::smf_app().info(
"- " SMF_CONFIG_STRING_SESSION_MANAGEMENT_SUBSCRIPTION_LIST ":");
for (int i = 0; i < num_session_management_subscription; i++) {
......
......@@ -238,8 +238,6 @@ class smf_config {
std::string api_version;
} nrf_addr;
// Local configuration
bool local_configuration;
#define SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX 5
struct {
snssai_t single_nssai;
......@@ -305,7 +303,6 @@ class smf_config {
nrf_addr.port = 80;
nrf_addr.api_version = "v1";
local_configuration = false;
num_session_management_subscription = 0;
for (int i = 0; i < SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX; i++) {
......
......@@ -104,7 +104,7 @@ bool pfcp_associations::add_association(
for (std::vector<std::shared_ptr<pfcp_association>>::iterator it =
pending_associations.begin();
it < pending_associations.end(); ++it) {
if ((*it)->node_id == node_id) {
if (((*it)->node_id == node_id) and ((*it)->is_upf_profile_set())) {
Logger::smf_app().info("Associate with UPF profile");
sa->set_upf_node_profile((*it)->get_upf_node_profile());
break;
......@@ -146,7 +146,7 @@ bool pfcp_associations::add_association(
for (std::vector<std::shared_ptr<pfcp_association>>::iterator it =
pending_associations.begin();
it < pending_associations.end(); ++it) {
if ((*it)->node_id == node_id) {
if (((*it)->node_id == node_id) and ((*it)->is_upf_profile_set())) {
Logger::smf_app().info("Associate with UPF profile");
sa->set_upf_node_profile((*it)->get_upf_node_profile());
break;
......
......@@ -145,6 +145,7 @@ class pfcp_association {
upf_node_profile = profile;
upf_profile_is_set = true;
};
bool is_upf_profile_set() { return upf_profile_is_set; }
void get_upf_node_profile(upf_profile& profile) const {
profile = upf_node_profile;
};
......
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