diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-10-28 13:29:11 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-10-30 15:23:18 +0100 |
commit | 3d557b18d099249b0d60ea91c72695a678c9465f (patch) | |
tree | b8e20a2cd54a345dedbcdb05905ce73c479db9f0 | |
parent | e7c427165f696d844be6761a27b3d7a66f5aa49c (diff) |
gprs: Ignore NS RESET_ACK and ALIVE_ACK without RESET
Currently those messages are answered by a NS_STATUS message when
received on an uninitialised (no NS_RESET hat been seen yet) NS_VC
which violates GPP TS 08.16 7.3.1 and 7.4.1.
This patch adds checks to gprs_ns_vc_create() and eventually returns
before the error NS_STATUS message is generated.
Sponsored-by: On-Waves ehf
-rw-r--r-- | src/gb/gprs_ns.c | 17 | ||||
-rw-r--r-- | tests/gb/gprs_ns_test.ok | 6 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 0e9156a3..55535ad7 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1127,12 +1127,29 @@ int gprs_ns_vc_create(struct gprs_ns_inst *nsi, struct msgb *msg, int rc; if (nsh->pdu_type == NS_PDUT_STATUS) { + /* Do not respond, see 3GPP TS 08.16, 7.5.1 */ LOGP(DNS, LOGL_INFO, "Ignoring NS STATUS from %s " "for non-existing NS-VC\n", gprs_ns_ll_str(fallback_nsvc)); return GPRS_NS_CS_SKIPPED; } + if (nsh->pdu_type == NS_PDUT_ALIVE_ACK) { + /* Ignore this, see 3GPP TS 08.16, 7.4.1 */ + LOGP(DNS, LOGL_INFO, "Ignoring NS ALIVE ACK from %s " + "for non-existing NS-VC\n", + gprs_ns_ll_str(fallback_nsvc)); + return GPRS_NS_CS_SKIPPED; + } + + if (nsh->pdu_type == NS_PDUT_RESET_ACK) { + /* Ignore this, see 3GPP TS 08.16, 7.3.1 */ + LOGP(DNS, LOGL_INFO, "Ignoring NS RESET ACK from %s " + "for non-existing NS-VC\n", + gprs_ns_ll_str(fallback_nsvc)); + return GPRS_NS_CS_SKIPPED; + } + /* Only the RESET procedure creates a new NSVC */ if (nsh->pdu_type != NS_PDUT_RESET) { /* Since we have no NSVC, we have to use a fake */ diff --git a/tests/gb/gprs_ns_test.ok b/tests/gb/gprs_ns_test.ok index 23c9e5f3..13d5f365 100644 --- a/tests/gb/gprs_ns_test.ok +++ b/tests/gb/gprs_ns_test.ok @@ -97,9 +97,6 @@ result (STATUS) = 0 PROCESSING ALIVE_ACK from 0x01020304:1111 0b -MESSAGE to BSS, msg length 7 -08 00 81 0a 02 81 0b - result (ALIVE_ACK) = 0 --- Send unexpected NS RESET ACK (should not be answered)--- @@ -107,9 +104,6 @@ result (ALIVE_ACK) = 0 PROCESSING RESET_ACK from 0x01020304:1111 03 01 82 e0 01 04 82 e0 00 -MESSAGE to BSS, msg length 15 -08 00 81 0a 02 89 03 01 82 e0 01 04 82 e0 00 - result (RESET_ACK) = 0 --- Setup, send BSSGP RESET --- |