Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet6/in6_ifattach.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet6/in6_ifattach.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.87 retrieving revision 1.87.6.1 diff -u -p -r1.87 -r1.87.6.1 --- src/sys/netinet6/in6_ifattach.c 2011/12/31 20:41:59 1.87 +++ src/sys/netinet6/in6_ifattach.c 2014/08/20 00:04:36 1.87.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: in6_ifattach.c,v 1.87 2011/12/31 20:41:59 christos Exp $ */ +/* $NetBSD: in6_ifattach.c,v 1.87.6.1 2014/08/20 00:04:36 tls Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.87 2011/12/31 20:41:59 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.87.6.1 2014/08/20 00:04:36 tls Exp $"); #include #include @@ -473,7 +473,7 @@ get_ifid(struct ifnet *ifp0, struct ifne } /* next, try to get it from some other hardware interface */ - TAILQ_FOREACH(ifp, &ifnet, if_list) { + IFNET_FOREACH(ifp) { if (ifp == ifp0) continue; if (in6_get_hw_ifid(ifp, in6) != 0) @@ -527,7 +527,7 @@ success: static int in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp) { - struct in6_ifaddr *ia; + struct in6_ifaddr *ia __diagused; struct in6_aliasreq ifra; struct nd_prefixctl pr0; int i, error; @@ -588,12 +588,7 @@ in6_ifattach_linklocal(struct ifnet *ifp } ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ -#ifdef DIAGNOSTIC - if (!ia) { - panic("ia == NULL in in6_ifattach_linklocal"); - /* NOTREACHED */ - } -#endif + KASSERTMSG(ia, "ia == NULL in in6_ifattach_linklocal"); /* * Make the link-local prefix (fe80::/64%link) as on-link. @@ -759,6 +754,8 @@ in6_ifattach(struct ifnet *ifp, struct i #ifdef IFT_PFSYNC case IFT_PFSYNC: #endif + ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL; + ND_IFINFO(ifp)->flags |= ND6_IFF_IFDISABLED; return; } @@ -789,6 +786,7 @@ in6_ifattach(struct ifnet *ifp, struct i * linklocals for 6to4 interface, but there's no use and * it is rather harmful to have one. */ + ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL; return; #endif case IFT_CARP: @@ -822,7 +820,9 @@ in6_ifattach(struct ifnet *ifp, struct i /* * assign a link-local address, if there's none. */ - if (ip6_auto_linklocal) { + if (!(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && + ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) + { ia = in6ifa_ifpforlinklocal(ifp, 0); if (ia == NULL && in6_ifattach_linklocal(ifp, altifp) != 0) { printf("%s: cannot assign link-local address\n", @@ -967,7 +967,7 @@ in6_tmpaddrtimer(void *ignored_arg) ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, NULL); memset(nullbuf, 0, sizeof(nullbuf)); - TAILQ_FOREACH(ifp, &ifnet, if_list) { + IFNET_FOREACH(ifp) { ndi = ND_IFINFO(ifp); if (memcmp(ndi->randomid, nullbuf, sizeof(nullbuf)) != 0) { /*