diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-24 14:08:29 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-24 14:08:29 +0000 |
commit | 1d59f8cd13bb465b5a7eb88cbd77fc0089685156 (patch) | |
tree | 8f0a56004d85562f537e5fc651004a1aadacf2b6 | |
parent | a0ae7b2b1afe102cb64d75d3c174f3c2b799aa1e (diff) |
When deleting a neighbor or a interface make sure that no events are pending.
Needed for reload support. OK norby@
-rw-r--r-- | usr.sbin/ospfd/interface.c | 9 | ||||
-rw-r--r-- | usr.sbin/ospfd/neighbor.c | 13 |
2 files changed, 20 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c index 30662c5164d..7b7d3785a3d 100644 --- a/usr.sbin/ospfd/interface.c +++ b/usr.sbin/ospfd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.55 2006/11/28 19:21:15 reyk Exp $ */ +/* $OpenBSD: interface.c,v 1.56 2007/01/24 14:08:28 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -213,6 +213,13 @@ if_del(struct iface *iface) while ((nbr = LIST_FIRST(&iface->nbr_list)) != NULL) nbr_del(nbr); + if (evtimer_pending(&iface->hello_timer, NULL)) + evtimer_del(&iface->hello_timer); + if (evtimer_pending(&iface->wait_timer, NULL)) + evtimer_del(&iface->wait_timer); + if (evtimer_pending(&iface->lsack_tx_timer, NULL)) + evtimer_del(&iface->lsack_tx_timer); + ls_ack_list_clr(iface); md_list_clr(&iface->auth_md_list); free(iface); diff --git a/usr.sbin/ospfd/neighbor.c b/usr.sbin/ospfd/neighbor.c index f544d167133..0bfc959b460 100644 --- a/usr.sbin/ospfd/neighbor.c +++ b/usr.sbin/ospfd/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.33 2006/08/06 12:36:23 claudio Exp $ */ +/* $OpenBSD: neighbor.c,v 1.34 2007/01/24 14:08:28 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -325,6 +325,17 @@ nbr_del(struct nbr *nbr) { ospfe_imsg_compose_rde(IMSG_NEIGHBOR_DOWN, nbr->peerid, 0, NULL, 0); + if (evtimer_pending(&nbr->inactivity_timer, NULL)) + evtimer_del(&nbr->inactivity_timer); + if (evtimer_pending(&nbr->db_tx_timer, NULL)) + evtimer_del(&nbr->db_tx_timer); + if (evtimer_pending(&nbr->lsreq_tx_timer, NULL)) + evtimer_del(&nbr->lsreq_tx_timer); + if (evtimer_pending(&nbr->ls_retrans_timer, NULL)) + evtimer_del(&nbr->ls_retrans_timer); + if (evtimer_pending(&nbr->adj_timer, NULL)) + evtimer_del(&nbr->adj_timer); + /* clear lists */ ls_retrans_list_clr(nbr); db_sum_list_clr(nbr); |