daniel has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/25078 )

Change subject: gpproxy: Route BSSGP STATUS with PDU_IN_ERROR containing a TMSI
......................................................................

gpproxy: Route BSSGP STATUS with PDU_IN_ERROR containing a TMSI

Derive a foreign TLLI from a TMSI and route the message according to it
Fixes TC_status_sig_ul_tmsi

Related: OS#4892
Change-Id: Iebda9e9fd433cd28c0f657adc4d475d4e6e247ba
---
M src/gb_proxy.c
1 file changed, 8 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index a45a83f..1e8bc96 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -1003,10 +1003,16 @@
        if (rc < 0)
                return rc;

-       if (TLVP_PRESENT(&tp_inner[0], BSSGP_IE_TLLI))
+       if (TLVP_PRESENT(&tp_inner[0], BSSGP_IE_TLLI)) {
                *tlli = osmo_load32be(TLVP_VAL(&tp_inner[0], BSSGP_IE_TLLI));
-       else
+       } else if (TLVP_PRESENT(&tp_inner[0], BSSGP_IE_TMSI)) {
+               /* we treat the TMSI like a TLLI and extract the NRI from it */
+               *tlli = osmo_load32be(TLVP_VAL(&tp_inner[0], BSSGP_IE_TMSI));
+               /* Convert the TMSI into a FOREIGN TLLI so it is routed 
appropriately */
+               *tlli = gprs_tmsi2tlli(*tlli, TLLI_FOREIGN);
+       } else {
                return -ENOENT;
+       }

        return 0;
 }

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

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: Iebda9e9fd433cd28c0f657adc4d475d4e6e247ba
Gerrit-Change-Number: 25078
Gerrit-PatchSet: 5
Gerrit-Owner: daniel <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to