diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2018-09-13 15:10:01 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2018-10-01 19:15:25 +0200 |
commit | 744f824a7315f8efaae40ea910955329f7b26e66 (patch) | |
tree | e87b6bd1436971bc75a5de3cf2ef8fdbbb37f5c7 /bfdd/event.c | |
parent | bfdd: disable echo on neighbor request (diff) | |
download | frr-744f824a7315f8efaae40ea910955329f7b26e66.tar.xz frr-744f824a7315f8efaae40ea910955329f7b26e66.zip |
bfdd: allow timer deactivation on shutdown
Peers being shutdown were keeping their timers, so move the cancel code
before the shutdown check.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/event.c')
-rw-r--r-- | bfdd/event.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bfdd/event.c b/bfdd/event.c index 63f64077e..3f48921af 100644 --- a/bfdd/event.c +++ b/bfdd/event.c @@ -39,6 +39,9 @@ void bfd_recvtimer_update(struct bfd_session *bs) { struct timeval tv = {.tv_sec = 0, .tv_usec = bs->detect_TO}; + /* Remove previous schedule if any. */ + bfd_recvtimer_delete(bs); + /* Don't add event if peer is deactivated. */ if (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_SHUTDOWN)) return; @@ -48,9 +51,6 @@ void bfd_recvtimer_update(struct bfd_session *bs) log_debug("%s: sec = %ld, usec = %ld", __func__, tv.tv_sec, tv.tv_usec); #endif /* BFD_EVENT_DEBUG */ - /* Remove previous schedule if any. */ - bfd_recvtimer_delete(bs); - thread_add_timer_tv(master, bfd_recvtimer_cb, bs, &tv, &bs->recvtimer_ev); } @@ -59,6 +59,9 @@ void bfd_echo_recvtimer_update(struct bfd_session *bs) { struct timeval tv = {.tv_sec = 0, .tv_usec = bs->echo_detect_TO}; + /* Remove previous schedule if any. */ + bfd_echo_recvtimer_delete(bs); + /* Don't add event if peer is deactivated. */ if (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_SHUTDOWN)) return; @@ -68,9 +71,6 @@ void bfd_echo_recvtimer_update(struct bfd_session *bs) log_debug("%s: sec = %ld, usec = %ld", __func__, tv.tv_sec, tv.tv_usec); #endif /* BFD_EVENT_DEBUG */ - /* Remove previous schedule if any. */ - bfd_echo_recvtimer_delete(bs); - thread_add_timer_tv(master, bfd_echo_recvtimer_cb, bs, &tv, &bs->echo_recvtimer_ev); } @@ -79,6 +79,9 @@ void bfd_xmttimer_update(struct bfd_session *bs, uint64_t jitter) { struct timeval tv = {.tv_sec = 0, .tv_usec = jitter}; + /* Remove previous schedule if any. */ + bfd_xmttimer_delete(bs); + /* Don't add event if peer is deactivated. */ if (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_SHUTDOWN)) return; @@ -88,9 +91,6 @@ void bfd_xmttimer_update(struct bfd_session *bs, uint64_t jitter) log_debug("%s: sec = %ld, usec = %ld", __func__, tv.tv_sec, tv.tv_usec); #endif /* BFD_EVENT_DEBUG */ - /* Remove previous schedule if any. */ - bfd_xmttimer_delete(bs); - thread_add_timer_tv(master, bfd_xmt_cb, bs, &tv, &bs->xmttimer_ev); } @@ -98,6 +98,9 @@ void bfd_echo_xmttimer_update(struct bfd_session *bs, uint64_t jitter) { struct timeval tv = {.tv_sec = 0, .tv_usec = jitter}; + /* Remove previous schedule if any. */ + bfd_echo_xmttimer_delete(bs); + /* Don't add event if peer is deactivated. */ if (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_SHUTDOWN)) return; @@ -107,9 +110,6 @@ void bfd_echo_xmttimer_update(struct bfd_session *bs, uint64_t jitter) log_debug("%s: sec = %ld, usec = %ld", __func__, tv.tv_sec, tv.tv_usec); #endif /* BFD_EVENT_DEBUG */ - /* Remove previous schedule if any. */ - bfd_echo_xmttimer_delete(bs); - thread_add_timer_tv(master, bfd_echo_xmt_cb, bs, &tv, &bs->echo_xmttimer_ev); } |