Change in libosmocore[master]: gprs_ns2_vc_fsm: ensure all state is resetted via force_unconf

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
Mon Jan 18 17:10:13 UTC 2021


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


Change subject: gprs_ns2_vc_fsm: ensure all state is resetted via force_unconf
......................................................................

gprs_ns2_vc_fsm: ensure all state is resetted via force_unconf

Change-Id: I240225ce82fa27dfcb5b4b8e2981bb4d8cc4cd70
---
M src/gb/gprs_ns2_vc_fsm.c
1 file changed, 8 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/22293/1

diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index e0ff05d..79a0d4a 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -57,6 +57,7 @@
 	int N;
 	/* The initiator is responsible to UNBLOCK the VC. The BSS is usually the initiator.
 	 * It can change during runtime. The side which blocks an unblocked side.*/
+	bool initiator;
 	bool initiate_block;
 	bool initiate_reset;
 	/* if blocked by O&M/vty */
@@ -228,6 +229,9 @@
 	struct gprs_ns2_vc_priv *priv = fi->priv;
 	struct gprs_ns2_inst *nsi = priv->nsvc->nse->nsi;
 
+	priv->initiate_reset = priv->initiate_block = priv->initiator;
+	priv->om_blocked = false;
+
 	switch (event) {
 	case GPRS_NS2_EV_REQ_START:
 		switch (priv->nsvc->mode) {
@@ -268,6 +272,9 @@
 
 	if (priv->initiate_reset) {
 		switch (event) {
+		case GPRS_NS2_EV_RX_RESET:
+			ns2_tx_reset_ack(priv->nsvc);
+			/* fall-through */
 		case GPRS_NS2_EV_RX_RESET_ACK:
 			osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_BLOCKED,
 						nsi->timeout[NS_TOUT_TNS_BLOCK], NS_TOUT_TNS_BLOCK);
@@ -683,8 +690,7 @@
 	nsvc->fi = fi;
 	priv = fi->priv = talloc_zero(fi, struct gprs_ns2_vc_priv);
 	priv->nsvc = nsvc;
-	priv->initiate_reset = initiator;
-	priv->initiate_block = initiator;
+	priv->initiator = initiator;
 
 	osmo_timer_setup(&priv->alive.timer, alive_timeout_handler, fi);
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I240225ce82fa27dfcb5b4b8e2981bb4d8cc4cd70
Gerrit-Change-Number: 22293
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/20210118/f9df5416/attachment.htm>


More information about the gerrit-log mailing list