From 450cdd8b187c9508889a379cd882800468a870fe Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 10 Nov 2017 13:25:58 +0900 Subject: [PATCH] ipa: Fix endianness of pseud-M3UA header Change-Id: I70b420fc2105bb6e486adecf9285fed2fb471f73 --- src/ipa.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ipa.c b/src/ipa.c index 11ff422a..36fbd38c 100644 --- a/src/ipa.c +++ b/src/ipa.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -169,18 +170,18 @@ static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg) data_hdr.si = MTP_SI_SCCP; if (asp->cfg.is_server) { /* Source: the PC of the routing key */ - data_hdr.opc = as->cfg.routing_key.pc; + data_hdr.opc = osmo_htonl(as->cfg.routing_key.pc); /* Destination: Based on VTY config */ - data_hdr.dpc = as->cfg.pc_override.dpc; + data_hdr.dpc = osmo_htonl(as->cfg.pc_override.dpc); } else { /* Source: Based on VTY config */ - data_hdr.opc = as->cfg.pc_override.dpc; + data_hdr.opc = osmo_htonl(as->cfg.pc_override.dpc); /* Destination: PC of the routing key */ - data_hdr.dpc = as->cfg.routing_key.pc; + data_hdr.dpc = osmo_htonl(as->cfg.routing_key.pc); } xua = m3ua_xfer_from_data(&data_hdr, msgb_l2(msg), msgb_l2len(msg)); - xua->mtp.opc = data_hdr.opc; - xua->mtp.dpc = data_hdr.dpc; + xua->mtp.opc = osmo_ntohl(data_hdr.opc); + xua->mtp.dpc = osmo_ntohl(data_hdr.dpc); return m3ua_hmdc_rx_from_l2(asp->inst, xua); }