mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 22:19:21 +00:00
bfdd: set session down after disabling it
If a session is no longer able to send/receive packets, it is very likely it will be down in a few milliseconds so lets speed up the process and correctly mark it as down. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
507d75d453
commit
8ee0862e80
14
bfdd/bfd.c
14
bfdd/bfd.c
@ -213,10 +213,13 @@ void bfd_session_disable(struct bfd_session *bs)
|
|||||||
|
|
||||||
/* Disable all timers. */
|
/* Disable all timers. */
|
||||||
bfd_recvtimer_delete(bs);
|
bfd_recvtimer_delete(bs);
|
||||||
bfd_echo_recvtimer_delete(bs);
|
|
||||||
bfd_xmttimer_delete(bs);
|
bfd_xmttimer_delete(bs);
|
||||||
bfd_echo_xmttimer_delete(bs);
|
ptm_bfd_echo_stop(bs);
|
||||||
bs->vrf = NULL;
|
bs->vrf = NULL;
|
||||||
|
bs->ifp = NULL;
|
||||||
|
|
||||||
|
/* Set session down so it doesn't report UP and disabled. */
|
||||||
|
ptm_bfd_sess_dn(bs, BD_PATH_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t ptm_bfd_gen_ID(void)
|
static uint32_t ptm_bfd_gen_ID(void)
|
||||||
@ -329,6 +332,13 @@ void ptm_bfd_sess_dn(struct bfd_session *bfd, uint8_t diag)
|
|||||||
bfd->demand_mode = 0;
|
bfd->demand_mode = 0;
|
||||||
monotime(&bfd->downtime);
|
monotime(&bfd->downtime);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Only attempt to send if we have a valid socket:
|
||||||
|
* this function might be called by session disablers and in
|
||||||
|
* this case we won't have a valid socket (i.e. interface was
|
||||||
|
* removed or VRF doesn't exist anymore).
|
||||||
|
*/
|
||||||
|
if (bfd->sock != -1)
|
||||||
ptm_bfd_snd(bfd, 0);
|
ptm_bfd_snd(bfd, 0);
|
||||||
|
|
||||||
/* Slow down the control packets, the connection is down. */
|
/* Slow down the control packets, the connection is down. */
|
||||||
|
Loading…
Reference in New Issue
Block a user