aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-01-18 10:47:33 +0100
committerAlexander Couzens <lynxis@fe80.eu>2021-01-18 10:47:33 +0100
commit7a7b20b7706647b57573a241e1983c96037c5b39 (patch)
treebdc1836f9f9d6a0d6c7bebc3066275d2b3e19526
parenta14b9d3089db3eb38d1c837a716f635c0bc28e6b (diff)
gprs_ns2_sns: clear local and remote entries when SNS failed
The local and remote entries should be cleared on SNS Size. Further it can be cleared when SNS failed (e.g. all NSVC become dead) so VTY doesn't show old entries before entering SNS Size. Related: OS#4949 Change-Id: Ie4db81acdd5f8ddf1a1f5dc7645d1144545d9c73
-rw-r--r--src/gb/gprs_ns2_sns.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index ceff1151..e574b44f 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -255,6 +255,19 @@ void ns2_sns_free_nsvc(struct gprs_ns2_vc *nsvc)
}
}
+static void ns2_clear_ipv46_entries(struct ns2_sns_state *gss)
+{
+ TALLOC_FREE(gss->ip4_local);
+ TALLOC_FREE(gss->ip4_remote);
+ TALLOC_FREE(gss->ip6_local);
+ TALLOC_FREE(gss->ip6_remote);
+
+ gss->num_ip4_local = 0;
+ gss->num_ip4_remote = 0;
+ gss->num_ip6_local = 0;
+ gss->num_ip6_remote = 0;
+}
+
static void ns2_vc_create_ip(struct osmo_fsm_inst *fi, struct gprs_ns2_nse *nse, const struct osmo_sockaddr *remote,
uint8_t sig_weight, uint8_t data_weight)
{
@@ -702,6 +715,8 @@ static void ns2_sns_st_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state
if (old_state != GPRS_SNS_ST_UNCONFIGURED)
ns2_prim_status_ind(gss->nse, NULL, 0, NS_AFF_CAUSE_SNS_FAILURE);
+ ns2_clear_ipv46_entries(gss);
+
/* no initial available */
if (!gss->initial)
return;
@@ -1349,6 +1364,7 @@ static void ns2_sns_st_all_action(struct osmo_fsm_inst *fi, uint32_t event, void
* gprs_ns2_free_nsvcs() will trigger NO_NSVC, prevent this from triggering a reselection */
gss->reselection_running = true;
gprs_ns2_free_nsvcs(nse);
+ ns2_clear_ipv46_entries(gss);
/* Choose the next sns endpoint. */
if (llist_empty(&gss->sns_endpoints)) {