daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/26036 )


Change subject: gbproxy: Route STATUS in PtP-BVC by TLLI/TMSI as well
......................................................................

gbproxy: Route STATUS in PtP-BVC by TLLI/TMSI as well

Related: SYS#5235, OS#4892
Change-Id: Ib31c60ba840522719f307df089efeb8f4da1d9ae
---
M src/gb_proxy.c
1 file changed, 21 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/36/26036/1

diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index 18e0efb..7333e80 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -380,6 +380,8 @@
        return gbprox_relay2peer(msg, sgsn_bvc, sig_bvci ? 0 : sgsn_bvc->bvci);
 }

+static int gbproxy_tlli_from_status_pdu(struct tlv_parsed *tp, uint32_t *tlli, 
char *log_pfx);
+
 /* Receive an incoming PTP message from a BSS-side NS-VC */
 static int gbprox_rx_ptp_from_bss(struct gbproxy_nse *nse, struct msgb *msg, 
uint16_t ns_bvci)
 {
@@ -496,12 +498,28 @@
                osmo_fsm_inst_dispatch(bss_bvc->fi, BSSGP_BVCFSM_E_RX_FC_BVC, 
msg);
                break;
        case BSSGP_PDUT_STATUS:
-               /* TODO: Implement by inspecting the contained PDU */
-               if (!TLVP_PRESENT(&tp, BSSGP_IE_PDU_IN_ERROR))
+       {
+               struct gbproxy_sgsn *sgsn;
+               /* Check if the status needs to be terminated locally */
+               uint8_t cause = *TLVP_VAL(&tp, BSSGP_IE_CAUSE);
+
+               LOGPNSE(nse, LOGL_NOTICE, "Rx STATUS cause=0x%02x(%s)\n", cause,
+                       bssgp_cause_str(cause));
+
+               if (gbproxy_tlli_from_status_pdu(&tp, &tlli, log_pfx) == 0)
+                       sgsn = gbproxy_select_sgsn(nse->cfg, &tlli);
+               else
+                       sgsn = gbproxy_select_sgsn(nse->cfg, NULL);
+
+               if (!sgsn) {
+                       rc = -EINVAL;
                        break;
-               LOGPBVC(bss_bvc, LOGL_ERROR, "Rx %s: Implementation missing\n", 
pdut_name);
+               }
+
+               rc = gbprox_relay2nse(msg, sgsn->nse, ns_bvci);
                break;
        }
+       }

        return 0;
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/26036
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: Ib31c60ba840522719f307df089efeb8f4da1d9ae
Gerrit-Change-Number: 26036
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <[email protected]>
Gerrit-MessageType: newchange

Reply via email to