diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2005-09-18 17:36:28 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2005-09-18 17:36:28 +0000 |
| commit | b1c53bc9c0e2a9ad962a7fe5ef91eb4a9362df4a (patch) | |
| tree | 3b72fca936f4938b785351a205954a3281449806 /sys/netinet | |
| parent | c33f2417a17948e83a3d7887c802386d46a18c77 (diff) | |
Notes
Diffstat (limited to 'sys/netinet')
| -rw-r--r-- | sys/netinet/in.c | 20 | ||||
| -rw-r--r-- | sys/netinet/in.h | 1 |
2 files changed, 13 insertions, 8 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index c5d148a1fe071..2eb5e94fce742 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); +} diff --git a/sys/netinet/in.h b/sys/netinet/in.h index f006ae3ea32f6..eede9115884ed 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -572,6 +572,7 @@ int in_localaddr(struct in_addr); int in_localip(struct in_addr); char *inet_ntoa(struct in_addr); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ +void in_ifdetach(struct ifnet *); #define in_hosteq(s, t) ((s).s_addr == (t).s_addr) #define in_nullhost(x) ((x).s_addr == INADDR_ANY) |
