Change in libosmocore[master]: gprs_ns2: fix NS STATUS validation

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


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

Change subject: gprs_ns2: fix NS STATUS validation
......................................................................

gprs_ns2: fix NS STATUS validation

The wrong TLVs were used.

Change-Id: I01339d93469285cc5340500717ab2b696284e12a
---
M src/gb/gprs_ns2_message.c
1 file changed, 3 insertions(+), 4 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_message.c b/src/gb/gprs_ns2_message.c
index dccf51d..5e3e025 100644
--- a/src/gb/gprs_ns2_message.c
+++ b/src/gb/gprs_ns2_message.c
@@ -95,12 +95,11 @@
 		return -1;
 	}
 
-	uint8_t _cause = tlvp_val8(tp, NS_IE_VCI, 0);
-
+	uint8_t _cause = tlvp_val8(tp, NS_IE_CAUSE, 0);
 	switch (_cause) {
 	case NS_CAUSE_NSVC_BLOCKED:
 	case NS_CAUSE_NSVC_UNKNOWN:
-		if (!TLVP_PRES_LEN(tp, NS_IE_CAUSE, 1)) {
+		if (!TLVP_PRES_LEN(tp, NS_IE_VCI, 1)) {
 			*cause = NS_CAUSE_MISSING_ESSENT_IE;
 			return -1;
 		}
@@ -110,7 +109,7 @@
 	case NS_CAUSE_PROTO_ERR_UNSPEC:
 	case NS_CAUSE_INVAL_ESSENT_IE:
 	case NS_CAUSE_MISSING_ESSENT_IE:
-		if (!TLVP_PRES_LEN(tp, NS_IE_CAUSE, 1)) {
+		if (!TLVP_PRES_LEN(tp, NS_IE_PDU, 1)) {
 			*cause = NS_CAUSE_MISSING_ESSENT_IE;
 			return -1;
 		}

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I01339d93469285cc5340500717ab2b696284e12a
Gerrit-Change-Number: 25390
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/ec073d4d/attachment.htm>


More information about the gerrit-log mailing list