]> git.baikalelectronics.ru Git - kernel.git/commit
6lowpan: lowpan_uncompress_addr with address_mode
authorAlexander Aring <alex.aring@gmail.com>
Fri, 16 Aug 2013 19:59:58 +0000 (21:59 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Aug 2013 20:23:12 +0000 (13:23 -0700)
commitd9f0a0a257c3cd37d9fb69529b954524c024739b
tree53ffb342699069a3a9da9b12d0e8974b26782565
parente32a708aca40925ca7e74d9625eadc23fb6f4cd7
6lowpan: lowpan_uncompress_addr with address_mode

This patch drops the pre and postcount calculation from the
lowpan_uncompress_addr function.We use instead a switch/case
over address_mode value. The original implementation has several
bugs in this function and it was hard to decrypt how it works.
To make it maintainable and fix these bugs this patch basically
reimplements lowpan_uncompress_addr from scratch.

A list of bugs we found in the current implementation:

1) Properly support uncompression of short-address based IPv6 addresses
   (instead of basically copying garbage)

2) Fix use and uncompression of long-addresses based IPv6 addresses

3) Add missing ff:fe00 in the case of SAM/DAM = 2 and M = 0

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Werner Almesberger <werner@almesberger.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee802154/6lowpan.c
net/ieee802154/6lowpan.h