diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-10-18 22:12:17 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-10-19 12:10:24 +0200 |
commit | f0f63a4113117cdd0cf2abf6ba5fb12828df7c60 (patch) | |
tree | 1426da6158815ebdb4e69a627914bf23cc935806 /openbsc/src | |
parent | da890c77330cd2e0f63ab0731fcc9cd2b2366c3c (diff) |
gbproxy: Reject SGSN UNITDATA messages with an invalid BVCI
Currently such messages lead to a creation of a new peer with the
SGSN's NSEI, which results in echoing the message back to the SGSN.
This patch modifies this by sending a STATUS response (invalid BVCI)
instead back to the SGSN.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/gprs/gb_proxy.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index a25a9f57b..dea6e3f87 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -693,11 +693,13 @@ int gbprox_rcvmsg(struct msgb *msg, uint16_t nsei, uint16_t ns_bvci, uint16_t ns /* else: SGSN -> BSS direction */ if (!peer) { - LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for " - "BVCI=%u via NSVC=%u/NSEI=%u\n", ns_bvci, - nsvci, nsei); - peer = peer_alloc(ns_bvci); - peer->nsei = nsei; + LOGP(DGPRS, LOGL_INFO, "Didn't find peer for " + "BVCI=%u for message from NSVC=%u/NSEI=%u (SGSN)\n", + ns_bvci, nsvci, nsei); + rate_ctr_inc(&get_global_ctrg()-> + ctr[GBPROX_GLOB_CTR_INV_BVCI]); + return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI, + &ns_bvci, msg); } if (peer->blocked) { LOGP(DGPRS, LOGL_NOTICE, "Dropping PDU for " |