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.orglynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/22340 )
Change subject: gprs_ns2_vc_fsm: check NSVCI match the NSE
......................................................................
gprs_ns2_vc_fsm: check NSVCI match the NSE
The NSVCI must match the PDUs. The only exception is a RESET with
dialect ipaccess. However those will be handled later.
Change-Id: I8518bdb03e9e33b04b77a2a346d04c5d29544a6c
---
M src/gb/gprs_ns2_vc_fsm.c
1 file changed, 15 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/22340/1
diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index ca33ade..3d22fd6 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -750,11 +750,10 @@
struct osmo_fsm_inst *fi = nsvc->fi;
int rc = 0;
uint8_t cause;
- uint16_t nsei;
+ uint16_t nsei, nsvci;
/* TODO: 7.2: on UNBLOCK/BLOCK: check if NS-VCI is correct,
* if not answer STATUS with "NS-VC unknown" */
- /* TODO: handle RESET with different VCI */
/* TODO: handle BLOCK/UNBLOCK/ALIVE with different VCI */
if (gprs_ns2_validate(nsvc, nsh->pdu_type, msg, tp, &cause)) {
@@ -777,6 +776,20 @@
}
}
+ if (nsvc->nsvci_is_valid && TLVP_PRESENT(tp, NS_IE_VCI)) {
+ nsvci = tlvp_val16be(tp, NS_IE_VCI);
+ if (nsvci != nsvc->nsvci) {
+ /* 48.016 § 7.3.1 send RESET_ACK to wrong NSVCI + ignore */
+ if (nsh->pdu_type == NS_PDUT_RESET)
+ ns2_tx_reset_ack(nsvc);
+
+ LOGP(DLNS, LOGL_ERROR, "NSEI=%05u (NSVCI=%05u) Rx %s with wrong NSVCI=%05u. Ignoring PDU.\n",
+ nsvc->nse->nsei, nsvc->nsvci,
+ get_value_string(gprs_ns_pdu_strings, nsh->pdu_type), nsvci);
+ goto out;
+ }
+ }
+
switch (nsh->pdu_type) {
case NS_PDUT_RESET:
osmo_fsm_inst_dispatch(fi, GPRS_NS2_EV_RX_RESET, tp);
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22340
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8518bdb03e9e33b04b77a2a346d04c5d29544a6c
Gerrit-Change-Number: 22340
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/20210120/d398dde6/attachment.htm>