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


Change subject: ns2: don't forward an invalid RESET PDU to the FSM
......................................................................

ns2: don't forward an invalid RESET PDU to the FSM

When receiving an invalid RESET (e.g. wrong NSEI or NSVCI) do not
forward the PDU to the NSVC fsm. Answer it with correct NSEI & NSVCI,
log the PDU, then ignore it.

Fixes: OS#5258
Change-Id: I6e562def9c5a1e4534d42884215272b1e66d26c2
---
M src/gb/gprs_ns2_vc_fsm.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/25774/1

diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index 726fc0c..d28897e 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -887,6 +887,8 @@
                        /* 48.016 ยง 7.3.1 send RESET_ACK to wrong NSVCI + 
ignore */
                        if (nsh->pdu_type == NS_PDUT_RESET) {
                                ns2_tx_reset_ack(nsvc);
+                               LOG_NS_SIGNAL(nsvc, "Rx", nsh->pdu_type, 
LOGL_ERROR, " with wrong NSVCI (exp: %05u, got %05u). Ignoring PDU.\n", 
nsvc->nsvci, nsvci);
+                               goto out;
                        } else if (nsh->pdu_type == NS_PDUT_STATUS) {
                                /* this is a PDU received over a NSVC and 
reports a status for another NSVC */
                                target_nsvc = 
gprs_ns2_nsvc_by_nsvci(nsvc->nse->nsi,  nsvci);

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6e562def9c5a1e4534d42884215272b1e66d26c2
Gerrit-Change-Number: 25774
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newchange

Reply via email to