From e222557f88664eba2422b9dd5a41cc268985861e Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 19 Jul 2023 17:34:34 +0200 Subject: [PATCH] [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. --- configs/open5gs/mme.yaml.in | 18 ++++++++---------- src/mme/mme-context.c | 7 ++----- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/configs/open5gs/mme.yaml.in b/configs/open5gs/mme.yaml.in index fc710cd6e..d74af085a 100644 --- a/configs/open5gs/mme.yaml.in +++ b/configs/open5gs/mme.yaml.in @@ -475,9 +475,9 @@ smf: - ::1 # -# +# # -# o Specify SGSN addresses the GTP-C must connect to +# o Specify SGSN addresses the GTPv1C must connect to # # o One SGSN is defined. # If prefer_ipv4 is not true, [fd69:f21d:873c:fa::2] is selected. @@ -513,15 +513,13 @@ smf: # rac: 187 # ci: 1223 # - name: sgsn3.open5gs.org -# routes: -# - default: true +# default_route: true # -#sgsn: -# - gtpc: -# addr: -# - 127.0.0.3 -# routes: -# - default: true +sgsn: + - gtpc: + addr: + - 127.0.0.3 + default_route: true # # o Disable use of IPv4 addresses (only IPv6) diff --git a/src/mme/mme-context.c b/src/mme/mme-context.c index 38a7a3201..31b05597c 100644 --- a/src/mme/mme-context.c +++ b/src/mme/mme-context.c @@ -1651,7 +1651,6 @@ int mme_context_parse_config(void) ogs_nas_rai_t rai; uint16_t cell_id = 0; bool rai_parsed = false, cell_id_parsed = false; - bool default_route = false; mme_sgsn_route_t *sgsn_rt = NULL; if (ogs_yaml_iter_type(&routes_array) == YAML_MAPPING_NODE) { @@ -1697,8 +1696,6 @@ int mme_context_parse_config(void) } while ( ogs_yaml_iter_type(&cell_id_iter) == YAML_SEQUENCE_NODE); - } else if (!strcmp(routes_key, "default")) { - default_route = true; } else ogs_warn("unknown key `%s`", routes_key); } @@ -1709,10 +1706,10 @@ int mme_context_parse_config(void) memcpy(&sgsn_rt->rai, &rai, sizeof(rai)); sgsn_rt->cell_id = cell_id; 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); + } else if (!strcmp(sgsn_key, "default_route")) { + sgsn->default_route = true; } } } while (ogs_yaml_iter_type(&sgsn_array) == YAML_SEQUENCE_NODE);