Change in libosmocore[master]: gprs_ns2_sns: add timeout to ST_CONFIG_SGSN

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:13 UTC 2021


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


Change subject: gprs_ns2_sns: add timeout to ST_CONFIG_SGSN
......................................................................

gprs_ns2_sns: add timeout to ST_CONFIG_SGSN

The state CONFIG_SGSN must be also protected by the timeout Tsns-prov.

Change-Id: I2700c1ad40ebe30658e9937d86a4861b0b59d6b6
---
M src/gb/gprs_ns2_sns.c
1 file changed, 12 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/22743/1

diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index a5b900f..3230b6e 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -853,6 +853,7 @@
 static void ns2_sns_st_config_bss(struct osmo_fsm_inst *fi, uint32_t event, void *data)
 {
 	struct tlv_parsed *tp = NULL;
+	struct gprs_ns2_nse *nse = nse_inst_from_fi(fi);
 
 	switch (event) {
 	case GPRS_SNS_EV_CONFIG_ACK:
@@ -862,7 +863,7 @@
 							 gprs_ns2_cause_str(*TLVP_VAL(tp, NS_IE_CAUSE)));
 			/* TODO: What to do? */
 		} else {
-			osmo_fsm_inst_state_chg(fi, GPRS_SNS_ST_CONFIG_SGSN, 0, 0);
+			osmo_fsm_inst_state_chg(fi, GPRS_SNS_ST_CONFIG_SGSN, nse->nsi->timeout[NS_TOUT_TSNS_PROV], 3);
 		}
 		break;
 	default:
@@ -944,10 +945,11 @@
 		ns2_tx_sns_config_ack(gss->sns_nsvc, NULL);
 		/* start the test procedure on ALL NSVCs! */
 		gprs_ns2_start_alive_all_nsvcs(nse);
-		osmo_fsm_inst_state_chg(fi, GPRS_SNS_ST_CONFIGURED, ns_sns_configured_timeout(fi), 3);
+		osmo_fsm_inst_state_chg(fi, GPRS_SNS_ST_CONFIGURED, ns_sns_configured_timeout(fi), 4);
 	} 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);
 	}
 }
 
@@ -1372,6 +1374,14 @@
 		}
 		break;
 	case 3:
+		if (gss->N >= nsi->timeout[NS_TOUT_TSNS_CONFIG_RETRIES]) {
+			LOGPFSML(fi, LOGL_ERROR, "NSE %d: Config retries failed. Selecting next IP-SNS endpoint.\n", nse->nsei);
+			osmo_fsm_inst_dispatch(fi, GPRS_SNS_EV_SELECT_ENDPOINT, NULL);
+		} else {
+			osmo_fsm_inst_state_chg(fi, GPRS_SNS_ST_CONFIG_SGSN, nsi->timeout[NS_TOUT_TSNS_PROV], 3);
+		}
+		break;
+	case 4:
 		LOGPFSML(fi, LOGL_ERROR, "NSE %d: Config succeeded but no NS-VC came online. Selecting next IP-SNS endpoint.\n", nse->nsei);
 		osmo_fsm_inst_dispatch(fi, GPRS_SNS_EV_SELECT_ENDPOINT, NULL);
 		break;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2700c1ad40ebe30658e9937d86a4861b0b59d6b6
Gerrit-Change-Number: 22743
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/233522d5/attachment.htm>


More information about the gerrit-log mailing list