diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 15:57:51 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 15:57:51 +0000 |
commit | a91920932b73637e1e04370c2f94e9b7d86f6792 (patch) | |
tree | b59c27be905ea51112c237f39a95a3de9cc17346 /usr.sbin/ldpd/adjacency.c | |
parent | 42abb432d9a0bf14357bb96f409eb021c9e27447 (diff) |
Remove duplicated code in timer functions.
Diffstat (limited to 'usr.sbin/ldpd/adjacency.c')
-rw-r--r-- | usr.sbin/ldpd/adjacency.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/usr.sbin/ldpd/adjacency.c b/usr.sbin/ldpd/adjacency.c index f8df2cecffa..4bcf9d884fc 100644 --- a/usr.sbin/ldpd/adjacency.c +++ b/usr.sbin/ldpd/adjacency.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adjacency.c,v 1.9 2016/05/23 15:47:24 renato Exp $ */ +/* $OpenBSD: adjacency.c,v 1.10 2016/05/23 15:57:50 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -229,24 +229,16 @@ tnbr_init(struct ldpd_conf *xconf, struct tnbr *tnbr) void tnbr_hello_timer(int fd, short event, void *arg) { - struct tnbr *tnbr = arg; - struct timeval tv; + struct tnbr *tnbr = arg; send_hello(HELLO_TARGETED, NULL, tnbr); - - /* reschedule hello_timer */ - timerclear(&tv); - tv.tv_sec = tnbr->hello_interval; - if (evtimer_add(&tnbr->hello_timer, &tv) == -1) - fatal(__func__); + tnbr_start_hello_timer(tnbr); } void tnbr_start_hello_timer(struct tnbr *tnbr) { - struct timeval tv; - - send_hello(HELLO_TARGETED, NULL, tnbr); + struct timeval tv; timerclear(&tv); tv.tv_sec = tnbr->hello_interval; |