]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: reset bfd session when bgp comes up 5957/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 10 Mar 2020 13:34:36 +0000 (14:34 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 10 Mar 2020 13:40:31 +0000 (14:40 +0100)
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>
bgpd/bgp_fsm.c

index 2a2e238799ac14312eb4ba7beaebd6d80e832ec7..86e1c8daccd0b3ab54d0649cf62319340a24df98 100644 (file)
@@ -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;
 }