Merged in antmerlino/nuttx/uncompress-addr-fix (pull request #786)

net/sixlowpan: Fixes decompression of ipaddr from MAC address. The logic used to populate the IP from the radio address should match sixlowpan_ipfromsaddr/sixlowpan_ipfromeaddr

Approved-by: GregoryN <gnutt@nuttx.org>
This commit is contained in:
Anthony Merlino 2018-12-16 21:39:40 +00:00 committed by GregoryN
parent 52aae032f7
commit 35232d4997
1 changed files with 11 additions and 4 deletions

View File

@ -513,6 +513,12 @@ 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 */
@ -522,6 +528,7 @@ static void uncompress_addr(FAR const struct netdev_varaddr_s *addr,
ipaddr[i] = (uint16_t)srcptr[1] << 8 | (uint16_t)srcptr[0];
#endif
}
srcptr += 2;
}