bfdd: deduplicate echo handling code

Use the standardized echo timer handling function.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
Rafael Zalamena 2019-01-31 14:16:09 -02:00
parent 0592db9630
commit 73c62f8eb3
2 changed files with 2 additions and 4 deletions

View File

@ -418,10 +418,9 @@ static void _bfd_session_update(struct bfd_session *bs,
goto skip_echo;
BFD_SET_FLAG(bs->flags, BFD_SESS_FLAG_ECHO);
ptm_bfd_echo_start(bs);
/* Activate/update echo receive timeout timer. */
bfd_echo_recvtimer_update(bs);
bs_echo_timer_handler(bs);
} else {
/* Check if echo mode is already disabled. */
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))

View File

@ -291,8 +291,7 @@ DEFPY(bfd_peer_echo, bfd_peer_echo_cmd, "[no] echo-mode",
BFD_SET_FLAG(bs->flags, BFD_SESS_FLAG_ECHO);
/* Apply setting immediately. */
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_SHUTDOWN)) {
ptm_bfd_echo_start(bs);
bfd_echo_recvtimer_update(bs);
bs_echo_timer_handler(bs);
}
}