summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2011-06-03 05:57:52 +0000
committerhrs <hrs@FreeBSD.org>2011-06-03 05:57:52 +0000
commit6dcb471d0b47e053eb788a920d8787f8c81e112f (patch)
treef5c92db11b59434934c47b2b1360598421138075 /sys/netinet6
parent7e254a82b1514ddec8ea068d512fa233afcc4ec7 (diff)
downloadFreeBSD-src-6dcb471d0b47e053eb788a920d8787f8c81e112f.zip
FreeBSD-src-6dcb471d0b47e053eb788a920d8787f8c81e112f.tar.gz
- style(9) fixes.
- Do break immediately as a link-local address is found. Submitted by: bz
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/nd6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 0eee982..518bdba 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1328,7 +1328,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
*/
if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
(ND.flags & (ND6_IFF_ACCEPT_RTADV |
- ND6_IFF_AUTO_LINKLOCAL)))
+ ND6_IFF_AUTO_LINKLOCAL)))
ND.flags &= ~ND6_IFF_IFDISABLED;
if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
@@ -1349,7 +1349,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
continue;
ia = (struct in6_ifaddr *)ifa;
if ((ia->ia6_flags & IN6_IFF_DUPLICATED) &&
- IN6_IS_ADDR_LINKLOCAL(&ia->ia_addr.sin6_addr)) {
+ IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia)))
duplicated_linklocal = 1;
break;
}
@@ -1401,8 +1401,10 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ia = (struct in6_ifaddr *)ifa;
- if (IN6_IS_ADDR_LINKLOCAL(&(ia->ia_addr.sin6_addr)))
+ if (IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia))) {
haslinklocal = 1;
+ break;
+ }
}
IF_ADDR_UNLOCK(ifp);
if (!haslinklocal)
OpenPOWER on IntegriCloud