summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd/neighbor.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-09-06 08:28:45 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-09-06 08:28:45 +0000
commitaae542ec0548e733acf0d2920d954b9875d2598c (patch)
tree5145bb6ca6c24fd3ff125b6a6409625f90077172 /usr.sbin/ldpd/neighbor.c
parentc61d22be34c39da43ae4cb1a635f4e8fc2921340 (diff)
The nbr_reset_*() timer fucntions are the same as the nbr_start_* function.
So replace the few calls to the reset function with nbr_start_*(). OK michele@
Diffstat (limited to 'usr.sbin/ldpd/neighbor.c')
-rw-r--r--usr.sbin/ldpd/neighbor.c60
1 files changed, 3 insertions, 57 deletions
diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c
index 607aea36b1a..fdb337b8498 100644
--- a/usr.sbin/ldpd/neighbor.c
+++ b/usr.sbin/ldpd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.19 2010/09/02 14:34:04 claudio Exp $ */
+/* $OpenBSD: neighbor.c,v 1.20 2010/09/06 08:28:44 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -137,16 +137,14 @@ nbr_fsm(struct nbr *nbr, enum nbr_event event)
switch (nbr_fsm_tbl[i].action) {
case NBR_ACT_RST_ITIMER:
- nbr_reset_itimer(nbr);
- break;
case NBR_ACT_STRT_ITIMER:
nbr_start_itimer(nbr);
break;
case NBR_ACT_RST_KTIMEOUT:
- nbr_reset_ktimeout(nbr);
+ nbr_start_ktimeout(nbr);
break;
case NBR_ACT_RST_KTIMER:
- nbr_reset_ktimer(nbr);
+ nbr_start_ktimer(nbr);
break;
case NBR_ACT_STRT_KTIMER:
nbr_act_session_operational(nbr);
@@ -365,18 +363,6 @@ nbr_stop_itimer(struct nbr *nbr)
fatal("nbr_stop_itimer");
}
-void
-nbr_reset_itimer(struct nbr *nbr)
-{
- struct timeval tv;
-
- timerclear(&tv);
- tv.tv_sec = nbr->holdtime;
-
- if (evtimer_add(&nbr->inactivity_timer, &tv) == -1)
- fatal("nbr_reset_itimer");
-}
-
/* Keepalive timer: timer to send keepalive message to neighbors */
void
@@ -414,20 +400,6 @@ nbr_stop_ktimer(struct nbr *nbr)
fatal("nbr_stop_ktimer");
}
-void
-nbr_reset_ktimer(struct nbr *nbr)
-{
- struct timeval tv;
-
- timerclear(&tv);
-
- /* XXX: just to be sure it will send three keepalives per period */
- tv.tv_sec = (time_t)(nbr->keepalive / KEEPALIVE_PER_PERIOD);
-
- if (evtimer_add(&nbr->keepalive_timer, &tv) == -1)
- fatal("nbr_reset_ktimer");
-}
-
/* Keepalive timeout: if the nbr hasn't sent keepalive */
void
@@ -462,18 +434,6 @@ nbr_stop_ktimeout(struct nbr *nbr)
fatal("nbr_stop_ktimeout");
}
-void
-nbr_reset_ktimeout(struct nbr *nbr)
-{
- struct timeval tv;
-
- timerclear(&tv);
- tv.tv_sec = nbr->keepalive;
-
- if (evtimer_add(&nbr->keepalive_timeout, &tv) == -1)
- fatal("nbr_reset_ktimeout");
-}
-
/* Init delay timer: timer to retry to iniziatize session */
void
@@ -515,19 +475,6 @@ nbr_pending_idtimer(struct nbr *nbr)
return (0);
}
-
-void
-nbr_reset_idtimer(struct nbr *nbr)
-{
- struct timeval tv;
-
- timerclear(&tv);
- tv.tv_sec = INIT_DELAY_TMR;
-
- if (evtimer_add(&nbr->initdelay_timer, &tv) == -1)
- fatal("nbr_reset_idtimer");
-}
-
int
nbr_establish_connection(struct nbr *nbr)
{
@@ -573,7 +520,6 @@ nbr_act_session_establish(struct nbr *nbr, int active)
nbr_fsm(nbr, NBR_EVT_INIT_SENT);
}
-
return (0);
}