summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/lsreq.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-03-13 09:36:07 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-03-13 09:36:07 +0000
commitdd04fb31dcdfd5cdb8b83a194fb03880f0a4854b (patch)
tree66a1d7675f61815b715acc1c834ab1ad97b7e2d4 /usr.sbin/ospfd/lsreq.c
parent72165f8a1a149e38e5164d3bde4360b52a8a4ffc (diff)
The return value of the start/stop timer functions is almost never checked.
Switch them to void functions and check if evtimer_add/del fails -- in which case we fatal() as there is no useful way to recover in such an event. OK norby@
Diffstat (limited to 'usr.sbin/ospfd/lsreq.c')
-rw-r--r--usr.sbin/ospfd/lsreq.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/usr.sbin/ospfd/lsreq.c b/usr.sbin/ospfd/lsreq.c
index 5f55e5f98c2..99df7da5272 100644
--- a/usr.sbin/ospfd/lsreq.c
+++ b/usr.sbin/ospfd/lsreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lsreq.c,v 1.13 2006/03/09 13:34:19 claudio Exp $ */
+/* $OpenBSD: lsreq.c,v 1.14 2006/03/13 09:36:06 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -220,28 +220,30 @@ ls_req_tx_timer(int fd, short event, void *arg)
if (nbr->state == NBR_STA_LOAD) {
timerclear(&tv);
tv.tv_sec = nbr->iface->rxmt_interval;
- evtimer_add(&nbr->lsreq_tx_timer, &tv);
+ if (evtimer_add(&nbr->lsreq_tx_timer, &tv) == -1)
+ fatal("ls_req_tx_timer");
}
}
-int
+void
start_ls_req_tx_timer(struct nbr *nbr)
{
struct timeval tv;
if (nbr == nbr->iface->self)
- return (0);
+ return;
timerclear(&tv);
-
- return (evtimer_add(&nbr->lsreq_tx_timer, &tv));
+ if (evtimer_add(&nbr->lsreq_tx_timer, &tv) == -1)
+ fatal("start_ls_req_tx_timer");
}
-int
+void
stop_ls_req_tx_timer(struct nbr *nbr)
{
if (nbr == nbr->iface->self)
- return (0);
+ return;
- return (evtimer_del(&nbr->lsreq_tx_timer));
+ if (evtimer_del(&nbr->lsreq_tx_timer) == -1)
+ fatal("stop_ls_req_tx_timer");
}