summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2020-03-10 14:34:36 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2020-03-10 14:40:31 +0100
commitbd540576afc47e3babbb87454a2303ba2382a80f (patch)
treee2d40cf83f404055603cdd85084e697aac6b8367
parente7db872b819b6be70dccf0c6e710e80124c4f86a (diff)
bgpd: reset bfd session when bgp comes up
This scenario has been seen against microtik virtual machine with bfd enabled. When remote microtik bgp reestablishes the bgp session after a bgp reset, the bgp establishment comes first, then bfd is initialising. The second point is true for microtik, but not for frrouting, as the frrouting, when receiving bfd down messages, is not at init state. Actually, bfd state is up, and sees the first bfd down packet from bfd as an issue. Consequently, the BGP session is cleared. The fix consists in resetting the BFD session, once BGP comes up. That permits to align state machines of both local and remote bfd. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
-rw-r--r--bgpd/bgp_fsm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 2a2e238799..86e1c8dacc 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -1935,6 +1935,7 @@ static int bgp_establish(struct peer *peer)
hash_release(peer->bgp->peerhash, peer);
hash_get(peer->bgp->peerhash, peer, hash_alloc_intern);
+ bgp_bfd_deregister_peer(peer);
bgp_bfd_register_peer(peer);
return ret;
}