Commit 8d879a3f authored by Tony Cheneau's avatar Tony Cheneau Committed by David S. Miller

6lowpan: lowpan_is_iid_16_bit_compressable() does not detect compressible address correctly

The current test is not RFC6282 compliant. The same issue has been found
and fixed in Contiki. This patch is basically a port of their fix.
Signed-off-by: default avatarTony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de179c8c
...@@ -92,9 +92,10 @@ ...@@ -92,9 +92,10 @@
*/ */
#define lowpan_is_iid_16_bit_compressable(a) \ #define lowpan_is_iid_16_bit_compressable(a) \
((((a)->s6_addr16[4]) == 0) && \ ((((a)->s6_addr16[4]) == 0) && \
(((a)->s6_addr16[5]) == 0) && \ (((a)->s6_addr[10]) == 0) && \
(((a)->s6_addr16[6]) == 0) && \ (((a)->s6_addr[11]) == 0xff) && \
((((a)->s6_addr[14]) & 0x80) == 0)) (((a)->s6_addr[12]) == 0xfe) && \
(((a)->s6_addr[13]) == 0))
/* multicast address */ /* multicast address */
#define is_addr_mcast(a) (((a)->s6_addr[0]) == 0xFF) #define is_addr_mcast(a) (((a)->s6_addr[0]) == 0xFF)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment