daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42933?usp=email )


Change subject: tcap_as_loadshare: Forward UDTS to the correct tcap-loadshare 
ASP
......................................................................

tcap_as_loadshare: Forward UDTS to the correct tcap-loadshare ASP

Related: SYS#8090
Change-Id: I2051aa9e84e553feb17daabb93ba3ce82358e0e4
---
M src/tcap_as_loadshare.c
1 file changed, 22 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran 
refs/changes/33/42933/1

diff --git a/src/tcap_as_loadshare.c b/src/tcap_as_loadshare.c
index f3fd2f9..058e0c3 100644
--- a/src/tcap_as_loadshare.c
+++ b/src/tcap_as_loadshare.c
@@ -485,9 +485,8 @@
                goto out_free_msgb;
        }

-       /* TODO: (How) should we route UDTS (CL/DR) messages containing TCAP? */
        /* TCAP uses only connectionless SCCP messages */
-       if (!(sua->hdr.msg_class == SUA_MSGC_CL && sua->hdr.msg_type == 
SUA_CL_CLDT)) {
+       if (sua->hdr.msg_class != SUA_MSGC_CL) {
                /* ignoring packets */
                rc = -EPROTONOSUPPORT;
                goto out_free_sua;
@@ -530,6 +529,27 @@
        }
        rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_TCAP_DECODED);

+       /* Handle UDTS message */
+       if (sua->hdr.msg_type == SUA_CL_CLDR) {
+               uint32_t *otid = NULL, *dtid = NULL;
+               if (rc & OTID_SET)
+                       otid = &parsed.otid;
+               if (rc & DTID_SET)
+                       dtid = &parsed.dtid;
+
+               /* Do not error out - either forward the UDTS or drop it */
+               rc = 0;
+
+               /* Address/tid needs to be swapped since the UDTS contains the 
TCAP message we originally forwarded the other way, not an answer */
+               struct tcap_trans_track_entry *entry = 
tcap_trans_track_entry_find(as, &calling_addr, dtid, &called_addr, otid);
+               if (entry)
+                       asp = entry->asp;
+               if (!asp && otid)
+                       asp = tcap_as_asp_find_by_tcap_id(as, &called_addr, 
&calling_addr, *otid);
+               if (!asp)
+                       LOGPAS(as, DLTCAP, LOGL_NOTICE, "Could not find an ASP 
for UDTS with otid %u/dtid %u\n", parsed.otid, parsed.dtid);
+       }
+
        /* TCAP messages towards the IPA nodes */
        switch (parsed.present) {
        case TCAP_TCMessage_PR_begin:

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42933?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I2051aa9e84e553feb17daabb93ba3ce82358e0e4
Gerrit-Change-Number: 42933
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <[email protected]>

Reply via email to