Change in libosmocore[master]: gprs_ns2_sns: reset the N of timeout when entering a new state

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Fri Feb 5 16:35:14 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/22744 )


Change subject: gprs_ns2_sns: reset the N of timeout when entering a new state
......................................................................

gprs_ns2_sns: reset the N of timeout when entering a new state

Otherwise retries are splitted between the states.

Change-Id: Iefde0c89965f0be899d6d1f096480f6fc79a92be
---
M src/gb/gprs_ns2_sns.c
1 file changed, 17 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/22744/1

diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index 3230b6e..88b7c74 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -726,8 +726,10 @@
 	int count;
 
 	/* on a generic failure, the timer callback will recover */
-	if (old_state != GPRS_SNS_ST_UNCONFIGURED)
+	if (old_state != GPRS_SNS_ST_UNCONFIGURED) {
+		gss->N = 0;
 		ns2_prim_status_ind(gss->nse, NULL, 0, GPRS_NS2_AFF_CAUSE_SNS_FAILURE);
+	}
 
 	gss->alive = false;
 	ns2_clear_ipv46_entries(gss);
@@ -874,6 +876,10 @@
 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:
@@ -1000,9 +1006,18 @@
 	} 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;
@@ -1335,6 +1350,7 @@
 				  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) |

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22744
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iefde0c89965f0be899d6d1f096480f6fc79a92be
Gerrit-Change-Number: 22744
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210205/450cd6c5/attachment.htm>


More information about the gerrit-log mailing list