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/netinet/ip_carp.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/netinet/ip_carp.c')
-rw-r--r-- | sys/netinet/ip_carp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index f81a8596044..9d392445a89 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.124 2006/05/18 12:39:23 mpf Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.125 2006/05/22 23:25:15 krw Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -835,8 +835,9 @@ carpdetach(struct carp_softc *sc) s = splnet(); if (sc->sc_carpdev != NULL) { - hook_disestablish(sc->sc_carpdev->if_linkstatehooks, - sc->lh_cookie); + if (sc->lh_cookie != NULL) + hook_disestablish(sc->sc_carpdev->if_linkstatehooks, + sc->lh_cookie); cif = (struct carp_if *)sc->sc_carpdev->if_carp; TAILQ_REMOVE(&cif->vhif_vrs, sc, sc_list); if (!--cif->vhif_nvrs) { |