aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-09-06 18:17:15 +0200
committerAlexander Couzens <lynxis@fe80.eu>2021-09-07 20:46:04 +0200
commiteec4f608b5fd036c8fcb0ea36568874353a13618 (patch)
tree0207f6087f45eaff622acc60ac28ac4a6660bce9
parent9cd9f6d53f9d9eae8b5d76bd31d9855240ee5ab3 (diff)
gprs_ns2: fix NS STATUS validation
The wrong TLVs were used. Change-Id: I01339d93469285cc5340500717ab2b696284e12a
-rw-r--r--src/gb/gprs_ns2_message.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gb/gprs_ns2_message.c b/src/gb/gprs_ns2_message.c
index dccf51d2..5e3e025d 100644
--- a/src/gb/gprs_ns2_message.c
+++ b/src/gb/gprs_ns2_message.c
@@ -95,12 +95,11 @@ static int ns2_validate_status(struct gprs_ns2_vc *nsvc, struct msgb *msg, struc
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 @@ static int ns2_validate_status(struct gprs_ns2_vc *nsvc, struct msgb *msg, struc
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;
}