daniel has uploaded this change for review.

View Change

tcap_as_loadshare: Fix compare ignoring non-TCAP messages and remove assert

The previous check in asp_loadshare_tcap_sccp() was was never true because it
checked msg class twice instead of class and type.

Also remove the OSMO_ASSERT in send_back_udts() limiting the function to
CL/DT messages.

Related: SYS#5432
Change-Id: I0831b289e4e4e94fd1b719e6c7164c3dd87c9f88
---
M src/tcap_as_loadshare.c
1 file changed, 2 insertions(+), 3 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/21/42821/1
diff --git a/src/tcap_as_loadshare.c b/src/tcap_as_loadshare.c
index a9783f5..f3fd2f9 100644
--- a/src/tcap_as_loadshare.c
+++ b/src/tcap_as_loadshare.c
@@ -419,8 +419,6 @@
struct osmo_mtp_transfer_param new_mtp;
uint32_t rctx;

- OSMO_ASSERT(orig_sua->hdr.msg_class == SUA_MSGC_CL && orig_sua->hdr.msg_type == SUA_CL_CLDT);
-
if (!xua_msg_get_u32p(orig_sua, SUA_IEI_PROTO_CLASS, &spare_proto))
return -EINVAL;

@@ -487,8 +485,9 @@
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_class != SUA_CL_CLDT) {
+ if (!(sua->hdr.msg_class == SUA_MSGC_CL && sua->hdr.msg_type == SUA_CL_CLDT)) {
/* ignoring packets */
rc = -EPROTONOSUPPORT;
goto out_free_sua;

To view, visit change 42821. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I0831b289e4e4e94fd1b719e6c7164c3dd87c9f88
Gerrit-Change-Number: 42821
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann@sysmocom.de>