On Mon, Nov 30, 2015 at 06:13:04PM +0100, Martin Pieuchot wrote:
> Considering the number of places where we do such iteration, if this
> is still possible we're in big troubles, this is just a leftover of
> old over engineering.
The check is done inconsistenly only sometimes.
Note that there is also a safety in in6_ifinit(), I think it should
also go away.
> ok?
OK bluhm@
>
> Index: netinet6/in6.c
> ===================================================================
> RCS file: /cvs/src/sys/netinet6/in6.c,v
> retrieving revision 1.179
> diff -u -p -r1.179 in6.c
> --- netinet6/in6.c 18 Nov 2015 13:58:02 -0000 1.179
> +++ netinet6/in6.c 30 Nov 2015 17:09:53 -0000
> @@ -1411,8 +1411,6 @@ in6ifa_ifpforlinklocal(struct ifnet *ifp
> struct ifaddr *ifa;
>
> TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
> - if (ifa->ifa_addr == NULL)
> - continue; /* just for safety */
> if (ifa->ifa_addr->sa_family != AF_INET6)
> continue;
> if (IN6_IS_ADDR_LINKLOCAL(IFA_IN6(ifa))) {
> @@ -1435,8 +1433,6 @@ in6ifa_ifpwithaddr(struct ifnet *ifp, st
> struct ifaddr *ifa;
>
> TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
> - if (ifa->ifa_addr == NULL)
> - continue; /* just for safety */
> if (ifa->ifa_addr->sa_family != AF_INET6)
> continue;
> if (IN6_ARE_ADDR_EQUAL(addr, IFA_IN6(ifa)))