From: radhika Date: Sat, 21 May 2016 08:16:14 +0000 (-0700) Subject: BGP:Fix for BFD sessions not getting replayed after quagga restart X-Git-Tag: frr-2.0-rc1~543 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8d78d8519401387fc6ce1fddccb937053bce0e97;p=matthieu%2Ffrr.git BGP:Fix for BFD sessions not getting replayed after quagga restart Signed-off-by: Radhika Mahankali Reviewed-by: Donald Sharp Reviewed-by: Kanna Rajagopal Ticket: CM-11055 Reviewed By: CCR-4773 Testing Done: Unit, PTM smoke, BGP neighbor smoke Issue: bgpd is not replaying the BFD registrations to PTM after quagga restart. Root Cause: This problem happens when BFD configuration is part of the peer group template. Currently, the BFD configuration is being copied to the peer from template as part of the AF (address family) configuration. But, when the saved config is used after the quagga restart the peer group template is applied to the peer before the AF configuration is configured for the template. Due to this the BFD configuration never gets copied from the template to the peer and the BGP peers have no BFD configuration after the restart Sample config which failed: router bgp 100 bgp router-id 10.10.0.1 no bgp default ipv4-unicast bgp bestpath as-path multipath-relax neighbor dpeergrp_2 peer-group neighbor dpeergrp_2 remote-as 100 neighbor dpeergrp_2 bfd neighbor dpeergrp_2 advertisement-interval 1 neighbor dpeergrp_2 timers connect 1 neighbor dpeergrp_4 peer-group neighbor dpeergrp_4 remote-as 400 neighbor dpeergrp_4 bfd neighbor dpeergrp_4 advertisement-interval 1 neighbor dpeergrp_4 timers connect 1 neighbor swp2s0.1 interface peer-group dpeergrp_2 neighbor swp18s3.1 interface peer-group dpeergrp_4 ! address-family ipv4 unicast redistribute connected route-map redist neighbor dpeergrp_2 activate neighbor dpeergrp_2 next-hop-self neighbor dpeergrp_2 default-originate neighbor dpeergrp_2 soft-reconfiguration inbound neighbor dpeergrp_4 activate neighbor dpeergrp_4 next-hop-self neighbor dpeergrp_4 default-originate neighbor dpeergrp_4 soft-reconfiguration inbound maximum-paths 14 exit-address-family Fix: Moved the BFD config copy from the peer group AF config copy function to the main peer group config copy function. --- diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 53251afd31..647ee8a354 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2199,6 +2199,8 @@ peer_group2peer_config_copy (struct peer_group *group, struct peer *peer) } peer->update_if = XSTRDUP (MTYPE_PEER_UPDATE_SOURCE, conf->update_if); } + + bgp_bfd_peer_group2peer_copy(conf, peer); } static void @@ -2343,8 +2345,6 @@ peer_group2peer_config_copy_af (struct peer_group *group, struct peer *peer, pfilter->usmap.name = NULL; pfilter->usmap.map = NULL; } - - bgp_bfd_peer_group2peer_copy(conf, peer); } /* Peer group's remote AS configuration. */