aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-02-06 16:33:29 +0100
committerHarald Welte <laforge@gnumonks.org>2011-02-06 16:33:29 +0100
commit5e106d7765945f25b98e60ea1255c9f9bb86cfa0 (patch)
tree0ce0f08af12a02445a006407d3378aaf45291da1 /openbsc
parent36f98d9c53e92a19b99a678ae7d713ef0055a8d5 (diff)
[gb_proxy] Convert a NS-BLOCK from BSS into BVC-RESET to SGSN
As we only have one NS-VC between gb_proxy and SGSN, we cannot forward a NS-BLOCK from the BSS to the SGSN, as it would affect all other BSS's, too. Thus, we check if we have an unblocked PTP-BVC in the NSVC to the BSS, and then issue a BVC-BLOCK towards the SGSN. This should prevent any further PDU's from the SGSN to be sent to this BSS.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gprs/gb_proxy.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 19f6cbff2..6de76b796 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -612,23 +612,42 @@ int gbprox_signal(unsigned int subsys, unsigned int signal,
nsvc->nsvci);
}
- /* We currently only care about signals from the SGSN */
- if (!nsvc->remote_end_is_sgsn)
- return 0;
-
- /* iterate over all BTS peers and send the respective PDU */
- llist_for_each_entry(peer, &gbprox_bts_peers, list) {
+ if (!nsvc->remote_end_is_sgsn) {
+ /* from BSS to SGSN */
+ peer = peer_by_nsvc(nsvc);
+ if (!peer) {
+ LOGP(DGPRS, LOGL_NOTICE, "signal %u for unknown peer "
+ "NSEI=%u/NSVCI=%u\n", signal, nsvc->nsei,
+ nsvc->nsvci);
+ return 0;
+ }
switch (signal) {
case S_NS_RESET:
- gprs_ns_tx_reset(peer->nsvc, nssd->cause);
- break;
case S_NS_BLOCK:
- gprs_ns_tx_block(peer->nsvc, nssd->cause);
- break;
- case S_NS_UNBLOCK:
- gprs_ns_tx_unblock(peer->nsvc);
+ if (!peer->blocked)
+ break;
+ LOGP(DGPRS, LOGL_NOTICE, "Converting NS_RESET from "
+ "NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n",
+ nsvc->nsei, nsvc->nsvci);
+ bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK, nsvc->nsei,
+ peer->bvci, 0);
break;
}
+ } else {
+ /* iterate over all BTS peers and send the respective PDU */
+ llist_for_each_entry(peer, &gbprox_bts_peers, list) {
+ switch (signal) {
+ case S_NS_RESET:
+ gprs_ns_tx_reset(peer->nsvc, nssd->cause);
+ break;
+ case S_NS_BLOCK:
+ gprs_ns_tx_block(peer->nsvc, nssd->cause);
+ break;
+ case S_NS_UNBLOCK:
+ gprs_ns_tx_unblock(peer->nsvc);
+ break;
+ }
+ }
}
return 0;
}