diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-07-12 13:31:21 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-07-12 13:31:21 +0000 |
commit | 3dc8cff9e6875638e98e202b9d06bd6d4f1e59cc (patch) | |
tree | 5523026d8e026265fd71cf2cbfa77fbe69319db4 /sys/netinet | |
parent | f90e7f70ccd22bbaedf27946aa5f0900fbdd01db (diff) |
- Add a flags argument to dohooks.
The flag can be either HOOK_REMOVE or HOOK_REMOVE|HOOK_FREE.
o HOOK_REMOVE removes the hook from the list before executing it.
o HOOK_FREE frees the hook after that.
- Let dostartuphooks use HOOK_REMOVE|HOOK_FREE so we can reclaim the memory.
- Let doshutdownhooks use HOOK_REMOVE so that when some shutdown hook
panics (they do that all the #@$%! time these days) we don't loop
for ever. Don't HOOK_FREE, it doesn't matter and I don't want to add
another possible panic condition for shutdown hooks.
- Actually free the pointer we're throwing away in hook_disestablish (I wonder
how much memory this has leaked over the years).
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index ac9c739454c..142848b69b2 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.27 2002/06/09 16:26:10 itojun Exp $ */ +/* $OpenBSD: in.c,v 1.28 2002/07/12 13:31:20 art Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -368,7 +368,7 @@ in_control(so, cmd, data, ifp) case SIOCSIFADDR: error = in_ifinit(ifp, ia, satosin(&ifr->ifr_addr), 1); if (!error) - dohooks(ifp->if_addrhooks); + dohooks(ifp->if_addrhooks, 0); return error; case SIOCSIFNETMASK: @@ -408,7 +408,7 @@ in_control(so, cmd, data, ifp) (ifra->ifra_broadaddr.sin_family == AF_INET)) ia->ia_broadaddr = ifra->ifra_broadaddr; if (!error) - dohooks(ifp->if_addrhooks); + dohooks(ifp->if_addrhooks, 0); return (error); case SIOCDIFADDR: @@ -416,7 +416,7 @@ in_control(so, cmd, data, ifp) TAILQ_REMOVE(&ifp->if_addrlist, (struct ifaddr *)ia, ifa_list); TAILQ_REMOVE(&in_ifaddr, ia, ia_list); IFAFREE((&ia->ia_ifa)); - dohooks(ifp->if_addrhooks); + dohooks(ifp->if_addrhooks, 0); break; #ifdef MROUTING |