From 1e65b0e7a138f9d4dff6746b0387319cc32571d9 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Fri, 29 Aug 2014 13:32:17 +0200 Subject: 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 --- openbsc/src/gprs/gb_proxy.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'openbsc/src') diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index b55bbae47..8b014eafc 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; -- cgit v1.2.3