diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-04-21 13:34:46 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-04-21 13:34:46 +0000 |
commit | b89b088d22bc5997203fe237b5a753d87e093901 (patch) | |
tree | 264ca81daf842b361b9e407454c0f9a771ee69b3 /sys | |
parent | 262f05396d5a5c57bd042445490c9de7c6730329 (diff) |
Catch failed hook_establish call immediately, rather than misbehaving and
panicing at detach time.
ok dhartmei@ henning@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/pf_if.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index 26ce0ee731e..4e03b185509 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.23 2004/12/22 17:17:55 dhartmei Exp $ */ +/* $OpenBSD: pf_if.c,v 1.24 2005/04/21 13:34:45 pascoe Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -179,6 +179,9 @@ pfi_attach_ifnet(struct ifnet *ifp) p->pfik_flags |= PFI_IFLAG_ATTACHED; p->pfik_ah_cookie = hook_establish(ifp->if_addrhooks, 1, pfi_kifaddr_update, p); + if (p->pfik_ah_cookie == NULL) + panic("pfi_attach_ifnet: cannot allocate '%s' address hook", + ifp->if_xname); pfi_index2kif[ifp->if_index] = p; pfi_dohooks(p); splx(s); |