diff --git a/net/sixlowpan/sixlowpan_hc06.c b/net/sixlowpan/sixlowpan_hc06.c index 8a8e87eb4e..aa1fe9468a 100644 --- a/net/sixlowpan/sixlowpan_hc06.c +++ b/net/sixlowpan/sixlowpan_hc06.c @@ -513,15 +513,22 @@ static void uncompress_addr(FAR const struct netdev_varaddr_s *addr, for (i = destndx; i < 8; i++) { + if (usemac) + { + ipaddr[i] = (uint16_t)srcptr[0] << 8 | (uint16_t)srcptr[1]; + } + else + { #ifdef CONFIG_ENDIAN_BIG - /* Preserve big-endian, network order */ + /* Preserve big-endian, network order */ - ipaddr[i] = (uint16_t)srcptr[0] << 8 | (uint16_t)srcptr[1]; + ipaddr[i] = (uint16_t)srcptr[0] << 8 | (uint16_t)srcptr[1]; #else - /* Preserve big-endian, network order */ + /* Preserve big-endian, network order */ - ipaddr[i] = (uint16_t)srcptr[1] << 8 | (uint16_t)srcptr[0]; + ipaddr[i] = (uint16_t)srcptr[1] << 8 | (uint16_t)srcptr[0]; #endif + } srcptr += 2; }