diff --git a/net/sixlowpan/sixlowpan_hc06.c b/net/sixlowpan/sixlowpan_hc06.c index 5fb1e81709..ebf7a318e2 100644 --- a/net/sixlowpan/sixlowpan_hc06.c +++ b/net/sixlowpan/sixlowpan_hc06.c @@ -499,9 +499,15 @@ static void uncompress_addr(FAR const struct netdev_varaddr_s *addr, for (i = destndx; i < endndx; i++) { - /* Big-endian, network order */ +#ifdef CONFIG_BIG_ENDIAN + /* Preserve big-endian, network order */ ipaddr[i] = (uint16_t)srcptr[0] << 8 | (uint16_t)srcptr[1]; +#else + /* Preserve big-endian, network order */ + + ipaddr[i] = (uint16_t)srcptr[1] << 8 | (uint16_t)srcptr[0]; +#endif srcptr += 2; }