diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-05-22 23:25:16 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-05-22 23:25:16 +0000 |
commit | 196832ded10fbdbcaa4c8e0bfd5b97dcd43b7cc9 (patch) | |
tree | 9a9034ec527c8ef2aa3602da01a00b01d90fc187 /sys/net/if_vlan.c | |
parent | cf376344d05470c4531028d23c1f50df3247a9d7 (diff) |
Check for NULL cookies before calling hook_disestablish(). Just in case
the establish calls were bypassed or failed.
ok mpf@
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r-- | sys/net/if_vlan.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index ab7813a6e4e..d8c4c99ccfa 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.67 2006/05/09 19:43:02 mpf Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.68 2006/05/22 23:25:15 krw Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -436,7 +436,8 @@ vlan_unconfig(struct ifnet *ifp) s = splnet(); LIST_REMOVE(ifv, ifv_list); - hook_disestablish(p->if_linkstatehooks, ifv->lh_cookie); + if (ifv->lh_cookie != NULL) + hook_disestablish(p->if_linkstatehooks, ifv->lh_cookie); /* The cookie is NULL if disestablished externally */ if (ifv->dh_cookie != NULL) hook_disestablish(p->if_detachhooks, ifv->dh_cookie); |