summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2008-01-12 17:08:34 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2008-01-12 17:08:34 +0000
commit71275cb1615732fdce1815a3d07d52852082e5ef (patch)
tree6a4cdc034f8a578c92c6ea6329b450ce5c657611 /sys
parent836b4855f0be8279745bddc45bb5403b396d43ae (diff)
Kill all timeouts and undo carp demotion on pfsync_clone_destroy.
Panic reported by deraadt. OK henning@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_pfsync.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 61e909655ca..2d3d3e4443a 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.88 2007/12/14 18:33:37 deraadt Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.89 2008/01/12 17:08:33 mpf Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -177,6 +177,16 @@ pfsync_clone_create(struct if_clone *ifc, int unit)
int
pfsync_clone_destroy(struct ifnet *ifp)
{
+ struct pfsync_softc *sc = ifp->if_softc;
+
+ timeout_del(&sc->sc_tmo);
+ timeout_del(&sc->sc_tdb_tmo);
+ timeout_del(&sc->sc_bulk_tmo);
+ timeout_del(&sc->sc_bulkfail_tmo);
+#if NCARP > 0
+ if (!pfsync_sync_ok)
+ carp_group_demote_adj(&sc->sc_if, -1);
+#endif
#if NBPFILTER > 0
bpfdetach(ifp);
#endif