]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: improve BFD with timers configuration
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 23 Mar 2021 15:19:20 +0000 (12:19 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 23 Mar 2021 15:40:11 +0000 (12:40 -0300)
Move `bgp_peer_config_apply` outside `bgp_peer_configure_bfd` (and
document it) so we only call the session installation once with one
set of timers. It also makes all calls of that function
equal (e.g. always calls `bgp_peer_config_apply` afterwards).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
bgpd/bgp_bfd.c
bgpd/bgp_bfd.h

index 7656ad59ec77f922da295b8109f4cb3930199262..f1bdcc8bb47505fff582b94d328c15868905b97c 100644 (file)
@@ -310,7 +310,6 @@ void bgp_peer_configure_bfd(struct peer *p, bool manual)
                                       p->nexthop.ifp->name);
 
        bfd_sess_enable(p->bfd_config->session, true);
-       bgp_peer_config_apply(p, p->group);
 }
 
 static void bgp_peer_remove_bfd(struct peer *p)
@@ -448,6 +447,8 @@ DEFUN (neighbor_bfd,
        else
                bgp_peer_configure_bfd(peer, true);
 
+       bgp_peer_config_apply(peer, peer->group);
+
        return CMD_SUCCESS;
 }
 
index ec2772b69b26a572056768565c1ccacc8b747252..9dca48a437bb402f8ee6d6cb03176090d47d2492 100644 (file)
@@ -60,6 +60,9 @@ extern void bgp_peer_config_apply(struct peer *p, struct peer_group *pg);
 /**
  * Allocates and configure BFD session for peer. If it is already configured,
  * then it does nothing.
+ *
+ * Always call `bgp_peer_config_apply` afterwards if you need the changes
+ * immediately applied.
  */
 extern void bgp_peer_configure_bfd(struct peer *p, bool manual);