summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-17 13:22:36 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-12-17 14:16:50 +0100
commitcc6ac4cdc4103cb68a3e161deb49dfb64c931adf (patch)
tree0aabeb0e1f0b0c4fb7c9b341441b6c5f9b338740 /src
parent5ab8e2cdfcdfb932b918405061798e0079223273 (diff)
ns: Force a defined state when sending NS RESET
Currently the state is assumed to remain the same while the reset procedure is active. While this works correctly in general, a single unexpected BLOCK_ACK or UNBLOCK_ACK can change the state but will not stop the reset procedure. The leads to repeated RESET messages, where the corresponding RESET_ACK is ignored. This is a stable state which can only be left by manual intervention or by reception of a RESET message from the peer. This commit changes the RESET timeout handler to set the state to BLOCKED/RESET when sending the new NS RESET message. Note that this should ensure a clean restart even if the state has been screwed up. It does not fix the handling of BLOCK_ACK or UNBLOCK_ACK in abnormal cases. Addresses: gprs_ns.c:349 NSEI=8895 Tx NS RESET (NSVCI=8895, cause=O&M intervention) gprs_ns.c:878 NSVCI=8895 Rx NS RESET ACK (NSEI=8895, NSVCI=8895) gprs_ns.c:887 NS RESET ACK Discarding unexpected message for NS-VCI 8895 from SGSN NSEI=8895 Ticket: OW#1551 Sponsored-by: On-Waves ehf
Diffstat (limited to 'src')
-rw-r--r--src/gb/gprs_ns.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index aa43bb8b..a29c9464 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -615,6 +615,12 @@ static void gprs_ns_timer_cb(void *data)
break;
case NSVC_TIMER_TNS_RESET:
rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_LOST_RESET]);
+ if (!(nsvc->state & NSE_S_RESET))
+ LOGP(DNS, LOGL_NOTICE,
+ "NSEI=%u Reset timed out but RESET flag is not set\n",
+ nsvc->nsei);
+ /* Mark NS-VC locally as blocked and dead */
+ nsvc->state = NSE_S_BLOCKED | NSE_S_RESET;
/* Chapter 7.3: Re-send the RESET */
gprs_ns_tx_reset(nsvc, NS_CAUSE_OM_INTERVENTION);
/* Re-start Tns-reset timer */