summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/in.c')
-rw-r--r--sys/netinet/in.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index c5d148a..2eb5e94 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -459,14 +459,6 @@ in_control(so, cmd, data, ifp, td)
* a routing process they will come back.
*/
in_ifadown(&ia->ia_ifa, 1);
- /*
- * XXX horrible hack to detect that we are being called
- * from if_detach()
- */
- if (ifaddr_byindex(ifp->if_index) == NULL) {
- in_pcbpurgeif0(&ripcbinfo, ifp);
- in_pcbpurgeif0(&udbinfo, ifp);
- }
EVENTHANDLER_INVOKE(ifaddr_event, ifp);
error = 0;
break;
@@ -1046,3 +1038,15 @@ in_delmulti(inm)
igmp_leavegroup(&my_inm);
IN_MULTI_UNLOCK();
}
+
+/*
+ * On interface removal, clean up IPv4 data structures hung off of the ifnet.
+ */
+void
+in_ifdetach(ifp)
+ struct ifnet *ifp;
+{
+
+ in_pcbpurgeif0(&ripcbinfo, ifp);
+ in_pcbpurgeif0(&udbinfo, ifp);
+}
OpenPOWER on IntegriCloud