From 0cdd712be343dbce63778982e6d10c8e37d00605 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Tue, 28 Aug 2018 11:52:42 +0200 Subject: fix unaligned access in abis_nm_rx_ipacc() Related: OS#3496 Change-Id: Ia9bdce39472719bfebec29e0a55a021ef45c8ea6 --- src/osmo-bsc/abis_nm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 4757c7217..7f919a43b 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -2662,9 +2663,7 @@ static int abis_nm_rx_ipacc(struct msgb *msg) DEBUGPC(DNM, "IP=%s ", inet_ntoa(addr)); } if (TLVP_PRESENT(&tp, NM_ATT_IPACC_DST_IP_PORT)) - DEBUGPC(DNM, "PORT=%u ", - ntohs(*((uint16_t *) - TLVP_VAL(&tp, NM_ATT_IPACC_DST_IP_PORT)))); + DEBUGPC(DNM, "PORT=%" SCNu16 " ", osmo_load16be(TLVP_VAL(&tp, NM_ATT_IPACC_DST_IP_PORT))); if (TLVP_PRESENT(&tp, NM_ATT_IPACC_STREAM_ID)) DEBUGPC(DNM, "STREAM=0x%02x ", *TLVP_VAL(&tp, NM_ATT_IPACC_STREAM_ID)); -- cgit v1.2.3