summaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-08-29 13:32:17 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2014-09-08 10:20:18 +0200
commit1e65b0e7a138f9d4dff6746b0387319cc32571d9 (patch)
treeb67ddba1039382a94a9f8bf085b0c14b68f0b2fb /openbsc/src/gprs/gb_proxy.c
parent17b42b81f026550f99ecb3b611dca944a8bc7bc5 (diff)
gbproxy: Forward SGSN originated STATUS messages with BVCI
Currently all STATUS messages coming from the SGSN are just logged and dropped. This prevents the PCU from recognising that the (secondary) SGSN doesn't know about a certain BVCI and might require a reset procedure. This patch changes gbprox_rx_sig_from_bss() to forward STATUS messages with cause "Invalid BVCI" containing a BVCI to the BSS. Note that this will not forward broken "Invalid BVCI" messages which do not include a BVCI IE. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy.c')
-rw-r--r--openbsc/src/gprs/gb_proxy.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index b55bbae..8b014ea 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -909,6 +909,7 @@ static int gbprox_rx_sig_from_sgsn(struct gbproxy_config *cfg,
uint16_t bvci;
struct msgb *msg;
int rc = 0;
+ int cause;
if (ns_bvci != 0 && ns_bvci != 1) {
LOGP(DGPRS, LOGL_NOTICE, "NSEI=%u(SGSN) BVCI=%u is not "
@@ -961,13 +962,16 @@ static int gbprox_rx_sig_from_sgsn(struct gbproxy_config *cfg,
LOGPC(DGPRS, LOGL_NOTICE, "\n");
goto err_mand_ie;
}
+ cause = *TLVP_VAL(&tp, BSSGP_IE_CAUSE);
LOGPC(DGPRS, LOGL_NOTICE,
"cause=0x%02x(%s) ", *TLVP_VAL(&tp, BSSGP_IE_CAUSE),
- bssgp_cause_str(*TLVP_VAL(&tp, BSSGP_IE_CAUSE)));
+ bssgp_cause_str(cause));
if (TLVP_PRESENT(&tp, BSSGP_IE_BVCI)) {
- uint16_t bvci = tlvp_val16_unal(&tp, BSSGP_IE_BVCI);
- LOGPC(DGPRS, LOGL_NOTICE,
- "BVCI=%u\n", ntohs(bvci));
+ bvci = ntohs(tlvp_val16_unal(&tp, BSSGP_IE_BVCI));
+ LOGPC(DGPRS, LOGL_NOTICE, "BVCI=%u\n", bvci);
+
+ if (cause == BSSGP_CAUSE_UNKNOWN_BVCI)
+ rc = gbprox_relay2bvci(cfg, msg, bvci, ns_bvci);
} else
LOGPC(DGPRS, LOGL_NOTICE, "\n");
break;