aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-10 09:07:04 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-27 09:44:29 +0100
commit058ae12135c2e94de5b949ed4066ae03bb8b8121 (patch)
tree1f505fa8a279c1bcca491ed01e673b0d59d3c5b9 /openbsc/src/gprs/gb_proxy.c
parentf9ffd1fa1811914ce6b19f1d17e7a908e550d358 (diff)
gbproxy: Discard UL PTP messages with an unknown BVCI
Currently all PTP messages are in general forwarded to the SGSN even when the BVCI is not known to the gbproxy. Only if message patching is active and the peer cannot be determined, a log message is generated, a STATUS message returned, and the message discarded. The intention for this was to keep the old gbproxy's behaviour if patching is disabled. But the code gets much more complex this way. Another drawback is that when the SGSN returns a corresponding STATUS message, it cannot be routed to the BSS where the original message came from. This patch therefore changes the behaviour to reject BSSGP PTP uplink messages immediately if the BVCI is not known. Fixes: Coverity CID 1244240 Ticket: OW#1317 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy.c')
-rw-r--r--openbsc/src/gprs/gb_proxy.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 9d2c774ee..ee296d106 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -792,20 +792,20 @@ static int gbprox_rx_ptp_from_bss(struct gbproxy_config *cfg,
int rc;
peer = gbproxy_peer_by_bvci(cfg, ns_bvci);
+ if (!peer) {
+ LOGP(DGPRS, LOGL_NOTICE, "Didn't find peer for "
+ "BVCI=%u for PTP message from NSVC=%u/NSEI=%u (BSS), "
+ "discarding message\n",
+ ns_bvci, nsvci, nsei);
+ return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI,
+ &ns_bvci, msg);
+ }
check_peer_nsei(peer, nsei);
- rc = gbprox_process_bssgp_ul(cfg, msg, peer);
- if (!rc) {
- if (!peer) {
- LOGP(DGPRS, LOGL_NOTICE, "Didn't find peer for "
- "BVCI=%u for PTP message from NSVC=%u/NSEI=%u (BSS)\n",
- ns_bvci, nsvci, nsei);
- return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI,
- &ns_bvci, msg);
- }
+ rc = gbprox_process_bssgp_ul(cfg, msg, peer);
+ if (!rc)
return 0;
- }
switch (pdu_type) {
case BSSGP_PDUT_FLOW_CONTROL_BVC: