daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/37674?usp=email )
Change subject: osmo_bsc_sigtran: Don't try to decode ipaccess_head a second time ......................................................................
osmo_bsc_sigtran: Don't try to decode ipaccess_head a second time
osmo_io segmentation will already parse the ipaccess_header and set msg->data to the payload of the control command.
Depends: Id91cddf9948ca49abf092850fae3a8f17e445b45 (libosmo-netif.git) Related: OS#6422 Change-Id: I300bbab3c0215d52bc5f6232ace5c37a6613feb7 --- M src/osmo-bsc/osmo_bsc_sigtran.c 1 file changed, 16 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/74/37674/1
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 224e2c6..cdc5785 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -38,6 +38,7 @@ #include <osmocom/bsc/paging.h> #include <osmocom/bsc/bssmap_reset.h> #include <osmocom/mgcp_client/mgcp_common.h> +#include <osmocom/netif/ipa.h>
/* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ @@ -733,9 +734,6 @@ * libosmo-sigtran doesn't know about, such as piggy-backed CTRL and/or MGCP */ static int asp_rx_unknown(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg) { - struct ipaccess_head *iph; - struct ipaccess_head_ext *iph_ext; - if (osmo_ss7_asp_get_proto(asp) != OSMO_SS7_ASP_PROT_IPA) { msgb_free(msg); return 0; @@ -743,15 +741,7 @@
switch (ppid_mux) { case IPAC_PROTO_OSMO: - if (msg->len < sizeof(*iph) + sizeof(*iph_ext)) { - LOGP(DMSC, LOGL_ERROR, "The message is too short.\n"); - msgb_free(msg); - return -EINVAL; - } - iph = (struct ipaccess_head *) msg->data; - iph_ext = (struct ipaccess_head_ext *) iph->data; - msg->l2h = iph_ext->data; - switch (iph_ext->proto) { + switch (osmo_ipa_msgb_cb_proto_ext(msg)) { case IPAC_PROTO_EXT_CTRL: return bsc_sccplite_rx_ctrl(asp, msg); case IPAC_PROTO_EXT_MGCP: