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,15 +513,22 @@ static void uncompress_addr(FAR const struct netdev_varaddr_s *addr,
|
||||||
|
|
||||||
for (i = destndx; i < 8; i++)
|
for (i = destndx; i < 8; i++)
|
||||||
{
|
{
|
||||||
|
if (usemac)
|
||||||
|
{
|
||||||
|
ipaddr[i] = (uint16_t)srcptr[0] << 8 | (uint16_t)srcptr[1];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
#ifdef CONFIG_ENDIAN_BIG
|
#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
|
#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
|
#endif
|
||||||
|
}
|
||||||
srcptr += 2;
|
srcptr += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue