]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: upon reconfiguration or bgp exchange failure, stop bfd.
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 10 Mar 2020 08:20:09 +0000 (09:20 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 10 Mar 2020 13:40:31 +0000 (14:40 +0100)
When bgp is updated with local source, the bgp session is reset; bfd
also must be reset. The bgp_stop() handler handles all kind of
unexpected failures, so the placeholder to deregister from bfd should be
ok, providing that when bgp establishes, a similar function in bgp will
recreate bfd context.
Note that the bfd session is not reset on one specific case, where BFD
down event is the last reset. In that case, we must let BFD to monitor
the link.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_fsm.c

index a44effaac5228bd96ea2912634244bbcebf9f403..2a2e238799ac14312eb4ba7beaebd6d80e832ec7 100644 (file)
@@ -1128,6 +1128,10 @@ int bgp_stop(struct peer *peer)
 
        peer->nsf_af_count = 0;
 
+       /* deregister peer */
+       if (peer->last_reset != PEER_DOWN_BFD_DOWN)
+               bgp_bfd_deregister_peer(peer);
+
        if (peer_dynamic_neighbor(peer)
            && !(CHECK_FLAG(peer->flags, PEER_FLAG_DELETE))) {
                if (bgp_debug_neighbor_events(peer))