Hi Hannes, On Wed, Aug 14, 2013 at 01:08:21PM +0200, Hannes Frederic Sowa wrote: > 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? > Of course, thanks for this hint I will take this on the list to change it for checking for a multicast address, too.
I looked in the implementation of ipv6_addr_type and some little thing confusing me. A local-link address is FE80::/64, but the __ipv6_addr_type function checks for FE80::/32. -- snip ... __be32 st; st = addr->s6_addr32[0]; ... if ((st & htonl(0xFFC00000)) == htonl(0xFE800000)) return ... -- end snip Is there some (addr->s6_addr32[1] == 0) check which I don't see? Regards Alex ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel