Change in libosmocore[master]: gprs_ns2: nsvc: react on STATUS PDUs with cause code NSVC UNKNOWN/NSV...

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
Tue Sep 7 23:45:39 UTC 2021


lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/25392 )

Change subject: gprs_ns2: nsvc: react on STATUS PDUs with cause code NSVC UNKNOWN/NSVC BLOCKED
......................................................................

gprs_ns2: nsvc: react on STATUS PDUs with cause code NSVC UNKNOWN/NSVC BLOCKED

A STATUS PDU with cause code NSVC UNKNOWN/NSVC BLOCKED informs the other
side about a state mismatch between the side.

Change-Id: Ib6a2424f3027a30f14ef0a9fc2230e6aae9a2a04
---
M src/gb/gprs_ns2_vc_fsm.c
1 file changed, 27 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index 989a00c..03a355b 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -616,7 +616,9 @@
 {
 	struct gprs_ns2_vc_priv *priv = fi->priv;
 	struct gprs_ns2_inst *nsi = ns_inst_from_fi(fi);
+	struct tlv_parsed *tp;
 	struct msgb *msg = data;
+	uint8_t cause;
 
 	switch (event) {
 	case GPRS_NS2_EV_REQ_OM_RESET:
@@ -707,6 +709,27 @@
 		if (fi->state == GPRS_NS2_ST_BLOCKED)
 			osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_BLOCKED, nsi->timeout[NS_TOUT_TNS_BLOCK], 0);
 		break;
+	case GPRS_NS2_EV_RX_STATUS:
+		tp = data;
+		cause = tlvp_val8(tp, NS_IE_CAUSE, 0);
+		switch (cause) {
+		case NS_CAUSE_NSVC_BLOCKED:
+			if (fi->state != GPRS_NS2_ST_BLOCKED) {
+				LOG_NS_SIGNAL(priv->nsvc, "Rx", NS_PDUT_STATUS, LOGL_ERROR, ": remote side reported blocked state.\n");
+				priv->initiate_block = false;
+				priv->accept_unitdata = false;
+				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_BLOCKED, nsi->timeout[NS_TOUT_TNS_BLOCK], 0);
+			}
+			break;
+		case NS_CAUSE_NSVC_UNKNOWN:
+			if (fi->state != GPRS_NS2_ST_RESET && fi->state != GPRS_NS2_ST_UNCONFIGURED) {
+				LOG_NS_SIGNAL(priv->nsvc, "Rx", NS_PDUT_STATUS, LOGL_ERROR, ": remote side reported unknown nsvc.\n");
+				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], 0);
+			}
+			break;
+		}
+
+		break;
 	}
 }
 
@@ -726,6 +749,7 @@
 			       S(GPRS_NS2_EV_RX_RESET) |
 			       S(GPRS_NS2_EV_RX_ALIVE) |
 			       S(GPRS_NS2_EV_RX_ALIVE_ACK) |
+			       S(GPRS_NS2_EV_RX_STATUS) |
 			       S(GPRS_NS2_EV_REQ_FORCE_UNCONFIGURED) |
 			       S(GPRS_NS2_EV_REQ_OM_RESET) |
 			       S(GPRS_NS2_EV_REQ_OM_BLOCK) |
@@ -894,6 +918,9 @@
 		/* UNITDATA have to free msg because it might send the msg layer upwards */
 		osmo_fsm_inst_dispatch(fi, GPRS_NS2_EV_RX_UNITDATA, msg);
 		return 0;
+	case NS_PDUT_STATUS:
+		osmo_fsm_inst_dispatch(fi, GPRS_NS2_EV_RX_STATUS, tp);
+		break;
 	default:
 		LOGPFSML(fi, LOGL_ERROR, "NSEI=%u Rx unknown NS PDU type %s\n", nsvc->nse->nsei,
 			 get_value_string(gprs_ns_pdu_strings, nsh->pdu_type));

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib6a2424f3027a30f14ef0a9fc2230e6aae9a2a04
Gerrit-Change-Number: 25392
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210907/f87af190/attachment.htm>


More information about the gerrit-log mailing list