diff mbox

6lowpan: handle only real link-local addresses

Message ID 1376430813-30982-1-git-send-email-alex.aring@gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Alexander Aring Aug. 13, 2013, 9:53 p.m. UTC
A link-local address isn't fe80::/10 it's fe80::/64
see http://tools.ietf.org/html/rfc4291#section-2.5.6
for more details.

Also fix a comment issue "local link" -> "link-local"

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 net/ieee802154/6lowpan.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Alexander Aring Aug. 13, 2013, 9:53 p.m. UTC | #1
The current implementation to uncompress addresses in a 6lowpan header
is completely broken.

This patch series fixes the parsing of addresses in a 6lowpan header.
It contains a major rewrite of the uncompress address function to parse
the address in a correct way.

Alexander Aring (5):
  6lowpan: init ipv6hdr buffer to zero
  6lowpan: introduce lowpan_fetch_skb function
  6lowpan: add function to uncompress multicast addr
  6lowpan: lowpan_uncompress_addr with address_mode
  6lowpan: handle context based source address

David Hauweele (1):
  6lowpan: Fix fragmentation with link-local compressed addresses

 net/ieee802154/6lowpan.c | 284 +++++++++++++++++++++++++++++++----------------
 net/ieee802154/6lowpan.h |  20 +++-
 2 files changed, 203 insertions(+), 101 deletions(-)
David Miller Aug. 13, 2013, 10:12 p.m. UTC | #2
You're submitting 7 patches, one set is numbered 1-6 and this
one has no number.

What in the world do you want me to do with these patches?

What tree are they targetted at?

Are there dependencies?

What order should I apply them in?

You've given me none of this information, therefore I am tossing
all of these patches and you will need to submit them properly
all over again.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Werner Almesberger Aug. 14, 2013, 10:24 a.m. UTC | #3
David Miller wrote:
> You're submitting 7 patches, one set is numbered 1-6 and this
> one has no number.

The unnumbered patch is independent from the rest. But yes, he
shouldn't have sent it in the same thread.

To provide a bit of context, 6LoWPAN support in the kernel is
currently in an embarrassingly badly broken state. On a good day,
you can get ping to an RFC-compliant peer to work, sometimes even
both ways, but only as long as you use link-local addresses and
keep the payload small. Beyond that, it's all bugland.

Alexander thus started to fix the 6LoWPAN issues he and others,
myself included, had bumped into. It's a lot of changes for a
relatively small file (6lowpan.c) and later on he'll have at
least one more batch for fragmentation, but when all that is
done, we'll finally have a stack that can actually do real work.

Alexander, since you'll have to re-submit anyway, you may want to
add a

Reviewed-by: Werner Almesberger <werner@almesberger.net>

to all the patches.

- Werner
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h
index 4b8f917..61f0ce9 100644
--- a/net/ieee802154/6lowpan.h
+++ b/net/ieee802154/6lowpan.h
@@ -83,8 +83,11 @@ 
 #define ipaddr_prefixcmp(addr1, addr2, length) \
 	(memcmp(addr1, addr2, length >> 3) == 0)
 
-/* local link, i.e. FE80::/10 */
-#define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80))
+/* link-local, i.e. FE80::/64 */
+#define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80) &&	\
+		(((a)->s6_addr16[1]) == 0) &&	\
+		(((a)->s6_addr16[2]) == 0) &&	\
+		(((a)->s6_addr16[3]) == 0))
 
 /*
  * check whether we can compress the IID to 16 bits,