X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/4d15aeb193b2c68f1d38666c317f8d3734f5f083..5ba3f43ea354af8ad55bea84372a2bc834d8757c:/bsd/netinet6/in6_ifattach.c diff --git a/bsd/netinet6/in6_ifattach.c b/bsd/netinet6/in6_ifattach.c index 804a77d8e..86759c202 100644 --- a/bsd/netinet6/in6_ifattach.c +++ b/bsd/netinet6/in6_ifattach.c @@ -72,6 +72,7 @@ #include #include #include +#include #include #include @@ -710,7 +711,7 @@ in6_ifattach_prelim(struct ifnet *ifp) * (previously, this was a silent error.) */ if ((ifp->if_flags & IFF_MULTICAST) == 0) { - nd6log((LOG_INFO, "in6_ifattach: ", + nd6log0((LOG_INFO, "in6_ifattach: ", "%s is not multicast capable, IPv6 not enabled\n", if_name(ifp))); return (EINVAL); @@ -732,6 +733,7 @@ skipmcast: pbuf = (void **)((intptr_t)base - sizeof(void *)); *pbuf = ext; ifp->if_inet6data = base; + IN6_IFEXTRA(ifp)->ii_llt = in6_lltattach(ifp); VERIFY(IS_P2ALIGNED(ifp->if_inet6data, sizeof(uint64_t))); } else { /* @@ -744,6 +746,11 @@ skipmcast: sizeof(IN6_IFEXTRA(ifp)->icmp6_ifstat)); bzero(&IN6_IFEXTRA(ifp)->in6_ifstat, sizeof(IN6_IFEXTRA(ifp)->in6_ifstat)); + IN6_IFEXTRA(ifp)->netsig_len = 0; + bzero(&IN6_IFEXTRA(ifp)->netsig, + sizeof(IN6_IFEXTRA(ifp)->netsig)); + bzero(IN6_IFEXTRA(ifp)->nat64_prefixes, sizeof(IN6_IFEXTRA(ifp)->nat64_prefixes)); + /* XXX TBD Purge the layer two table */ /* * XXX When recycling, nd_ifinfo gets initialized, other * than the lock, inside nd6_ifattach @@ -995,11 +1002,14 @@ in6_ifdetach(struct ifnet *ifp) struct in6_multi_mship *imm; int unlinked; - lck_mtx_assert(nd6_mutex, LCK_MTX_ASSERT_NOTOWNED); + LCK_MTX_ASSERT(nd6_mutex, LCK_MTX_ASSERT_NOTOWNED); /* remove neighbor management table */ nd6_purge(ifp); + if (LLTABLE6(ifp)) + lltable_free(LLTABLE6(ifp)); + /* nuke any of IPv6 addresses we have */ lck_rw_lock_exclusive(&in6_ifaddr_rwlock); ia = in6_ifaddrs;