laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42821?usp=email )

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

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(-)

Approvals:
  Jenkins Builder: Verified
  lynxis lazus: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




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 https://gerrit.osmocom.org/c/libosmo-sigtran/+/42821?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I0831b289e4e4e94fd1b719e6c7164c3dd87c9f88
Gerrit-Change-Number: 42821
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>

Reply via email to