diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-08-28 11:52:42 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-09-28 23:18:24 +0000 |
commit | 0cdd712be343dbce63778982e6d10c8e37d00605 (patch) | |
tree | 42e55780bea100db9147e398ceff7e927ef7e848 | |
parent | 8afdeee22ee69591477fa7ac2c2d6d9fbc40ef05 (diff) |
fix unaligned access in abis_nm_rx_ipacc()
Related: OS#3496
Change-Id: Ia9bdce39472719bfebec29e0a55a021ef45c8ea6
-rw-r--r-- | src/osmo-bsc/abis_nm.c | 5 |
1 files 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 <libgen.h> #include <time.h> #include <limits.h> +#include <inttypes.h> #include <sys/stat.h> #include <netinet/in.h> @@ -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)); |