mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
Merged in antmerlino/nuttx/sixlowpan_hc06_fix (pull request #644)
sixlowpan: Preserve big-endian (network order) when uncompressing address. This change is the counterpart to another recent endianness fix that occurred on compression of the ip address. Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
034ab467e6
commit
19ebdb4ef9
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user