aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-10-14 22:06:48 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-15 10:20:34 +0200
commit5e6d679df39e5e20b55ef24754a4e6310c9bcad2 (patch)
tree762c75f088dd6b287f4cc2765657d085b43ed45e /include/osmocom
parent96550e03214697be2d1b303a690ef10ea3bb12b7 (diff)
gb: Fix gprs_ns_rx_reset to not create NS-VC duplicates
Under special circumstances (see below) receiving a NS-RESET leads to duplicated NS-VC entries. This happens when the source port of a NS-VC changes to a new one that has already been used by another NS-VC. This patch changes gprs_ns_rx_reset() to check for this case and to use the existing NS-VC object. The NS-VC object that was associated with the source address before is detached from this source but kept in the NS-VC list so that it can be reattached when a correspondent NS-RESET is received later on. Meanwhile it will have a cleared link layer address which will not match a real link info. A new counter NS_CTR_REPLACED is incremented each time when the NS-VC object is replacing another one. A new signal S_NS_REPLACED is added which gets dispatched in this case, too. Another new counter NS_CTR_NSEI_CHG is incremented each time when the NSEI of a NS-VC object (with fixed NSVCI) changes. Ticket: OW#874 Sponsored-by: On-Waves ehf
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/gprs/gprs_ns.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h
index 7b0ec92d..b28c58d6 100644
--- a/include/osmocom/gprs/gprs_ns.h
+++ b/include/osmocom/gprs/gprs_ns.h
@@ -119,6 +119,7 @@ struct gprs_nsvc {
unsigned int remote_end_is_sgsn:1;
unsigned int persistent:1;
+ unsigned int nsvci_is_valid:1;
struct rate_ctr_group *ctrg;
@@ -197,10 +198,12 @@ enum signal_ns {
S_NS_BLOCK,
S_NS_UNBLOCK,
S_NS_ALIVE_EXP, /* Tns-alive expired more than N times */
+ S_NS_REPLACED, /* nsvc object is replaced (sets old_nsvc) */
};
struct ns_signal_data {
struct gprs_nsvc *nsvc;
+ struct gprs_nsvc *old_nsvc;
uint8_t cause;
};