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

Function in_ifscrub_all

freebsd/netinet/in.c:1099–1130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1097}
1098
1099void
1100in_ifscrub_all(void)
1101{
1102 struct ifnet *ifp;
1103 struct ifaddr *ifa, *nifa;
1104 struct ifaliasreq ifr;
1105
1106 IFNET_RLOCK();
1107 CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) {
1108 /* Cannot lock here - lock recursion. */
1109 /* NET_EPOCH_ENTER(et); */
1110 CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) {
1111 if (ifa->ifa_addr->sa_family != AF_INET)
1112 continue;
1113
1114 /*
1115 * This is ugly but the only way for legacy IP to
1116 * cleanly remove addresses and everything attached.
1117 */
1118 bzero(&ifr, sizeof(ifr));
1119 ifr.ifra_addr = *ifa->ifa_addr;
1120 if (ifa->ifa_dstaddr)
1121 ifr.ifra_broadaddr = *ifa->ifa_dstaddr;
1122 (void)in_control(NULL, SIOCDIFADDR, (caddr_t)&ifr,
1123 ifp, NULL);
1124 }
1125 /* NET_EPOCH_EXIT(et); */
1126 in_purgemaddrs(ifp);
1127 igmp_domifdetach(ifp);
1128 }
1129 IFNET_RUNLOCK();
1130}
1131
1132int
1133in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia)

Callers 1

ip_destroyFunction · 0.85

Calls 4

bzeroFunction · 0.85
in_controlFunction · 0.85
in_purgemaddrsFunction · 0.85
igmp_domifdetachFunction · 0.85

Tested by

no test coverage detected