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:
parent
52aae032f7
commit
35232d4997
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue