lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130814112903.GB1704@x61s.8.8.8.8>
Date:	Wed, 14 Aug 2013 13:29:04 +0200
From:	Alexander Aring <alex.aring@...il.com>
To:	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

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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ