aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-10-24 12:48:56 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-24 18:02:38 +0200
commit64cb9246346ed991fceb4f749b15daf7177b201c (patch)
tree3a402fd7dcca7b50646df48a2c26e654d048e09d /openbsc/src/gprs
parent72b401f33df215173aa9b3a6f8237115a3d5f0b5 (diff)
gbproxy: Fix handling of NSEI changes
The gbproxy looses NSEI changes on BVC_RESET and then tries to send later messages to the wrong (not longer existing) destination. This patch fixes this by updating the peer's nsei field on BVC_RESET. Ticket: OW#874 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gb_proxy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index f008b3ee9..f9001586f 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -183,10 +183,10 @@ static int check_peer_nsei(struct gbprox_peer *peer, uint16_t nsei)
"BVCI=%u via NSEI=%u (expected NSEI=%u)\n",
peer->bvci, nsei, peer->nsei);
rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_INV_NSEI]);
- return 1;
+ return 0;
}
- return 0;
+ return 1;
}
static struct gbprox_peer *peer_alloc(uint16_t bvci)
@@ -432,7 +432,10 @@ static int gbprox_rx_sig_from_bss(struct msgb *msg, uint16_t nsei,
from_peer = peer_alloc(bvci);
from_peer->nsei = nsei;
}
- check_peer_nsei(from_peer, nsei);
+
+ if (!check_peer_nsei(from_peer, nsei))
+ from_peer->nsei = nsei;
+
if (TLVP_PRESENT(&tp, BSSGP_IE_CELL_ID)) {
struct gprs_ra_id raid;
/* We have a Cell Identifier present in this