diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2021-02-05 17:18:39 +0100 |
---|---|---|
committer | Alexander Couzens <lynxis@fe80.eu> | 2021-02-09 16:46:16 +0100 |
commit | 790a963fa2c54e5cded7d328006c9a92921a79b6 (patch) | |
tree | f8ddcd7059fabbbafa476b29f4b5e1ebfb9e6527 /src | |
parent | 3df5886c576522c52c8d9700a90a69b4255363dc (diff) |
gprs_ns2_sns: reset the N of timeout when entering a new state
Otherwise retries are splitted between the states.
Related: OS#5355
Change-Id: Iefde0c89965f0be899d6d1f096480f6fc79a92be
Diffstat (limited to 'src')
-rw-r--r-- | src/gb/gprs_ns2_sns.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c index e84c79d4..cd0a2112 100644 --- a/src/gb/gprs_ns2_sns.c +++ b/src/gb/gprs_ns2_sns.c @@ -727,6 +727,9 @@ static void ns2_sns_st_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state /* on a generic failure, the timer callback will recover */ if (old_state != GPRS_SNS_ST_UNCONFIGURED) ns2_prim_status_ind(gss->nse, NULL, 0, GPRS_NS2_AFF_CAUSE_SNS_FAILURE); + if (old_state != GPRS_SNS_ST_SIZE) + gss->N = 0; + gss->alive = false; ns2_clear_ipv46_entries(gss); @@ -873,6 +876,10 @@ static void ns2_sns_st_config_bss(struct osmo_fsm_inst *fi, uint32_t event, void static void ns2_sns_st_config_bss_onenter(struct osmo_fsm_inst *fi, uint32_t old_state) { struct ns2_sns_state *gss = (struct ns2_sns_state *) fi->priv; + + if (old_state != GPRS_SNS_ST_CONFIG_BSS) + gss->N = 0; + /* Transmit SNS-CONFIG */ switch (gss->ip) { case IPv4: @@ -999,9 +1006,18 @@ static void ns_sns_st_config_sgsn_ip6(struct osmo_fsm_inst *fi, uint32_t event, } else { /* just send CONFIG-ACK */ ns2_tx_sns_config_ack(gss->sns_nsvc, NULL); + osmo_timer_schedule(&fi->timer, nse->nsi->timeout[NS_TOUT_TSNS_PROV], 0); } } +static void ns2_sns_st_config_sgsn_onenter(struct osmo_fsm_inst *fi, uint32_t old_state) +{ + struct ns2_sns_state *gss = (struct ns2_sns_state *) fi->priv; + + if (old_state != GPRS_SNS_ST_CONFIG_SGSN) + gss->N = 0; +} + static void ns2_sns_st_config_sgsn(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct ns2_sns_state *gss = (struct ns2_sns_state *) fi->priv; @@ -1334,6 +1350,7 @@ static const struct osmo_fsm_state ns2_sns_bss_states[] = { S(GPRS_SNS_ST_SIZE), .name = "CONFIG_SGSN", .action = ns2_sns_st_config_sgsn, + .onenter = ns2_sns_st_config_sgsn_onenter, }, [GPRS_SNS_ST_CONFIGURED] = { .in_event_mask = S(GPRS_SNS_EV_ADD) | |