MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _in6_ifdetach

Function _in6_ifdetach

freebsd/netinet6/in6_ifattach.c:754–788  ·  view source on GitHub ↗

* NOTE: in6_ifdetach() does not support loopback if at this moment. * * When shutting down a VNET we clean up layers top-down. In that case * upper layer protocols (ulp) are cleaned up already and locks are destroyed * and we must not call into these cleanup functions anymore, thus purgeulp * is set to 0 in that case by in6_ifdetach_destroy(). * The normal case of destroying a (cloned) inte

Source from the content-addressed store, hash-verified

752 * everything related to the interface and will have purgeulp set to 1.
753 */
754static void
755_in6_ifdetach(struct ifnet *ifp, int purgeulp)
756{
757 struct ifaddr *ifa, *next;
758
759 if (ifp->if_afdata[AF_INET6] == NULL)
760 return;
761
762 /*
763 * nuke any of IPv6 addresses we have
764 */
765 CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
766 if (ifa->ifa_addr->sa_family != AF_INET6)
767 continue;
768 in6_purgeaddr(ifa);
769 }
770 if (purgeulp) {
771 IN6_MULTI_LOCK();
772 in6_pcbpurgeif0(&V_udbinfo, ifp);
773 in6_pcbpurgeif0(&V_ulitecbinfo, ifp);
774 in6_pcbpurgeif0(&V_ripcbinfo, ifp);
775 IN6_MULTI_UNLOCK();
776 }
777 /* leave from all multicast groups joined */
778 in6_purgemaddrs(ifp);
779
780 /*
781 * Remove neighbor management table.
782 * Enabling the nd6_purge will panic on vmove for interfaces on VNET
783 * teardown as the IPv6 layer is cleaned up already and the locks
784 * are destroyed.
785 */
786 if (purgeulp)
787 nd6_purge(ifp);
788}
789
790void
791in6_ifdetach(struct ifnet *ifp)

Callers 2

in6_ifdetachFunction · 0.85
in6_ifdetach_destroyFunction · 0.85

Calls 4

in6_purgeaddrFunction · 0.85
in6_pcbpurgeif0Function · 0.85
in6_purgemaddrsFunction · 0.85
nd6_purgeFunction · 0.85

Tested by

no test coverage detected