]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Process directly connected IBGP peers upon interface down
authorvivek <vivek@cumulusnetworks.com>
Thu, 8 Sep 2016 17:03:30 +0000 (10:03 -0700)
committervivek <vivek@cumulusnetworks.com>
Thu, 8 Sep 2016 17:03:30 +0000 (10:03 -0700)
When we have a single-hop BFD session for any peering, it really means
that the peering is directly connected (maybe over a L2 network), whether
it is IBGP or EBGP. In such a case, upon link down, immediately process
IBGP peers too (and bring them down), not just EBGP peers.

This change eliminates some peculiar state transitions in specific IBGP
topologies, thus getting rid of the problem of nexthops remaining inactive
in the zebra RIB.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-12390
Reviewed By: CCR-5156
Testing Done: Manual, bgp-smoke

bgpd/bgp_bfd.c
bgpd/bgp_bfd.h
bgpd/bgp_zebra.c

index b8b005369529e4f62f29c2c70d37f3554394ea73..aeac93e7b3dc9d31567d55f564ddca6977e2c855 100644 (file)
@@ -71,7 +71,7 @@ bgp_bfd_peer_group2peer_copy(struct peer *conf, struct peer *peer)
 /*
  * bgp_bfd_is_peer_multihop - returns whether BFD peer is multi-hop or single hop.
  */
-static int
+int
 bgp_bfd_is_peer_multihop(struct peer *peer)
 {
   struct bfd_info *bfd_info;
index 4e554af6968fbae80ea7a2712910e0f7e1002a35..e872637e3eb7ed107b7eb23e6f488d8648cf75c4 100644 (file)
@@ -42,4 +42,7 @@ bgp_bfd_peer_config_write(struct vty *vty, struct peer *peer, char *addr);
 extern void
 bgp_bfd_show_info(struct vty *vty, struct peer *peer, u_char use_json, json_object *json_neigh);
 
+extern int
+bgp_bfd_is_peer_multihop(struct peer *peer);
+
 #endif /* _QUAGGA_BGP_BFD_H */
index b4bac840e3755d5ed1d4b61484465edf129a18e7..6e17d778abcf8d422d25f9af6d46c24878cfbdb5 100644 (file)
@@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA.  */
 #include "bgpd/bgp_mpath.h"
 #include "bgpd/bgp_nexthop.h"
 #include "bgpd/bgp_nht.h"
+#include "bgpd/bgp_bfd.h"
 
 /* All information about zebra. */
 struct zclient *zclient = NULL;
@@ -358,7 +359,16 @@ bgp_interface_down (int command, struct zclient *zclient, zebra_size_t length,
 
     for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
       {
+#if defined(HAVE_CUMULUS)
+        /* Take down directly connected EBGP peers as well as 1-hop BFD
+         * tracked (directly connected) IBGP peers.
+         */
+        if ((peer->ttl != 1) && (peer->gtsm_hops != 1) &&
+            (!peer->bfd_info || bgp_bfd_is_peer_multihop(peer)))
+#else
+        /* Take down directly connected EBGP peers */
         if ((peer->ttl != 1) && (peer->gtsm_hops != 1))
+#endif
           continue;
 
         if (ifp == peer->nexthop.ifp)