daniel has uploaded this change for review.
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 change 42933. To unsubscribe, or for help writing mail filters, visit settings.