From: Alexander Aring <alex.aring@gmail.com>
To: alex.bluesman.smirnov@gmail.com
Cc: dbaryshkov@gmail.com, davem@davemloft.net,
linux-zigbee-devel@lists.sourceforge.net, netdev@vger.kernel.org,
Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH] 6lowpan: handle only real link-local addresses
Date: Tue, 13 Aug 2013 23:53:26 +0200 [thread overview]
Message-ID: <1376430813-30982-1-git-send-email-alex.aring@gmail.com> (raw)
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(-)
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,
--
1.8.3.3
next reply other threads:[~2013-08-13 21:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-13 21:53 Alexander Aring [this message]
2013-08-13 21:53 ` [PATCH 0/6] 6lowpan: uncompress of addresses fix Alexander Aring
[not found] ` <1376430813-30982-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-08-13 21:53 ` [PATCH 1/6] 6lowpan: init ipv6hdr buffer to zero Alexander Aring
2013-08-13 21:53 ` [PATCH 2/6] 6lowpan: Fix fragmentation with link-local compressed addresses Alexander Aring
2013-08-13 21:53 ` [PATCH 3/6] 6lowpan: introduce lowpan_fetch_skb function Alexander Aring
2013-08-13 21:53 ` [PATCH 5/6] 6lowpan: lowpan_uncompress_addr with address_mode Alexander Aring
2013-08-13 21:53 ` [PATCH 4/6] 6lowpan: add function to uncompress multicast addr Alexander Aring
2013-08-13 21:53 ` [PATCH 6/6] 6lowpan: handle context based source address Alexander Aring
2013-08-13 22:12 ` [PATCH] 6lowpan: handle only real link-local addresses David Miller
2013-08-14 10:24 ` [Linux-zigbee-devel] " Werner Almesberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1376430813-30982-1-git-send-email-alex.aring@gmail.com \
--to=alex.aring@gmail.com \
--cc=alex.bluesman.smirnov@gmail.com \
--cc=davem@davemloft.net \
--cc=dbaryshkov@gmail.com \
--cc=linux-zigbee-devel@lists.sourceforge.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).