[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130814110821.GH16264@order.stressinduktion.org>
Date: Wed, 14 Aug 2013 13:08:21 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Alexander Aring <alex.aring@...il.com>
Cc: alex.bluesman.smirnov@...il.com, dbaryshkov@...il.com,
davem@...emloft.net, linux-zigbee-devel@...ts.sourceforge.net,
netdev@...r.kernel.org
Subject: Re: [PATCHv2 net-next] 6lowpan: handle only real link-local addresses
On Wed, Aug 14, 2013 at 01:01:07PM +0200, Alexander Aring wrote:
> 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))
>
Can't you use ipv6_addr_type(a)&IPV6_ADDR_LINKLOCAL?
Greetings,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists