[MME] rework sgsn default route config in mme.yaml

Move the config to the sgsn node instead of having a specific route with
specific format "default: route", since anyway internally it's already
applied to the sgsn object.
This commit is contained in:
Pau Espin 2023-07-19 17:34:34 +02:00 committed by Sukchan Lee
parent 64a35611d8
commit e222557f88
2 changed files with 10 additions and 15 deletions

View File

@ -475,9 +475,9 @@ smf:
- ::1 - ::1
# #
# <GTP-C Client> # <GTPv1C Client>
# #
# o Specify SGSN addresses the GTP-C must connect to # o Specify SGSN addresses the GTPv1C must connect to
# #
# o One SGSN is defined. # o One SGSN is defined.
# If prefer_ipv4 is not true, [fd69:f21d:873c:fa::2] is selected. # If prefer_ipv4 is not true, [fd69:f21d:873c:fa::2] is selected.
@ -513,15 +513,13 @@ smf:
# rac: 187 # rac: 187
# ci: 1223 # ci: 1223
# - name: sgsn3.open5gs.org # - name: sgsn3.open5gs.org
# routes: # default_route: true
# - default: true
# #
#sgsn: sgsn:
# - gtpc: - gtpc:
# addr: addr:
# - 127.0.0.3 - 127.0.0.3
# routes: default_route: true
# - default: true
# #
# o Disable use of IPv4 addresses (only IPv6) # o Disable use of IPv4 addresses (only IPv6)

View File

@ -1651,7 +1651,6 @@ int mme_context_parse_config(void)
ogs_nas_rai_t rai; ogs_nas_rai_t rai;
uint16_t cell_id = 0; uint16_t cell_id = 0;
bool rai_parsed = false, cell_id_parsed = false; bool rai_parsed = false, cell_id_parsed = false;
bool default_route = false;
mme_sgsn_route_t *sgsn_rt = NULL; mme_sgsn_route_t *sgsn_rt = NULL;
if (ogs_yaml_iter_type(&routes_array) == YAML_MAPPING_NODE) { if (ogs_yaml_iter_type(&routes_array) == YAML_MAPPING_NODE) {
@ -1697,8 +1696,6 @@ int mme_context_parse_config(void)
} while ( } while (
ogs_yaml_iter_type(&cell_id_iter) == ogs_yaml_iter_type(&cell_id_iter) ==
YAML_SEQUENCE_NODE); YAML_SEQUENCE_NODE);
} else if (!strcmp(routes_key, "default")) {
default_route = true;
} else } else
ogs_warn("unknown key `%s`", routes_key); ogs_warn("unknown key `%s`", routes_key);
} }
@ -1709,10 +1706,10 @@ int mme_context_parse_config(void)
memcpy(&sgsn_rt->rai, &rai, sizeof(rai)); memcpy(&sgsn_rt->rai, &rai, sizeof(rai));
sgsn_rt->cell_id = cell_id; sgsn_rt->cell_id = cell_id;
ogs_list_add(&sgsn->route_list, sgsn_rt); ogs_list_add(&sgsn->route_list, sgsn_rt);
if (default_route)
sgsn->default_route = true;
} while (ogs_yaml_iter_type(&routes_array) == YAML_SEQUENCE_NODE); } while (ogs_yaml_iter_type(&routes_array) == YAML_SEQUENCE_NODE);
} else if (!strcmp(sgsn_key, "default_route")) {
sgsn->default_route = true;
} }
} }
} while (ogs_yaml_iter_type(&sgsn_array) == YAML_SEQUENCE_NODE); } while (ogs_yaml_iter_type(&sgsn_array) == YAML_SEQUENCE_NODE);