kern/111513: [patch] in6_setscope() sets scope flags wrong
Thomas Karcher
thkarcher at gmx.de
Thu Apr 12 15:00:05 UTC 2007
>Number: 111513
>Category: kern
>Synopsis: [patch] in6_setscope() sets scope flags wrong
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Apr 12 15:00:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Thomas Karcher
>Release: RELENG_6_2_0_RELEASE
>Organization:
>Environment:
>Description:
In netinet6/scope6.c is a function called "in6_setscope()" which sets the appropriate scope flag for an IPv6 (in my case multicast) address.
I think line 475 is not correct, it looks like this:
474 if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6))
475 in6->s6_addr16[1] = htons(zoneid & 0xffff);
The scope is usually just 8 bits after the 1111 1111 (FF) start of a multicast address. E. g. if I want to sent a multicast over a local link, the address should start with FF02 - the 2 is for link-local scope.
Unfortunately, the code above sets 16 bits in the second 16-bit-part of the address, so it starts with FF00:0002 which is simply wrong.
I didn't check other parts of the file for the same error.
>How-To-Repeat:
>Fix:
To my extent, it should be as follows:
474 if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6))
475 in6->s6_addr8[1] = htons(zoneid & 0xff);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list