Commit 8d879a3f9856fe6c6e27853a96c0beaed03acb2c

Authored by Tony Cheneau
Committed by David S. Miller
1 parent de179c8c12

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: Tony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 4 additions and 3 deletions Side-by-side Diff

net/ieee802154/6lowpan.h
... ... @@ -92,9 +92,10 @@
92 92 */
93 93 #define lowpan_is_iid_16_bit_compressable(a) \
94 94 ((((a)->s6_addr16[4]) == 0) && \
95   - (((a)->s6_addr16[5]) == 0) && \
96   - (((a)->s6_addr16[6]) == 0) && \
97   - ((((a)->s6_addr[14]) & 0x80) == 0))
  95 + (((a)->s6_addr[10]) == 0) && \
  96 + (((a)->s6_addr[11]) == 0xff) && \
  97 + (((a)->s6_addr[12]) == 0xfe) && \
  98 + (((a)->s6_addr[13]) == 0))
98 99  
99 100 /* multicast address */
100 101 #define is_addr_mcast(a) (((a)->s6_addr[0]) == 0xFF)