diff options
author | vivek <vivek@cumulusnetworks.com> | 2016-09-08 19:03:30 +0200 |
---|---|---|
committer | vivek <vivek@cumulusnetworks.com> | 2016-09-08 19:03:30 +0200 |
commit | 8c4f63817a1861adf8dba97849c4ef60b17432bc (patch) | |
tree | 6b6ad6ba40c99eb1421f87a2bb92cb07d293cb24 /bgpd | |
parent | lib, bgpd: Log next hops (diff) | |
download | frr-8c4f63817a1861adf8dba97849c4ef60b17432bc.tar.xz frr-8c4f63817a1861adf8dba97849c4ef60b17432bc.zip |
bgpd: Process directly connected IBGP peers upon interface down
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
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_bfd.c | 2 | ||||
-rw-r--r-- | bgpd/bgp_bfd.h | 3 | ||||
-rw-r--r-- | bgpd/bgp_zebra.c | 10 |
3 files changed, 14 insertions, 1 deletions
diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index b8b005369..aeac93e7b 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -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; diff --git a/bgpd/bgp_bfd.h b/bgpd/bgp_bfd.h index 4e554af69..e872637e3 100644 --- a/bgpd/bgp_bfd.h +++ b/bgpd/bgp_bfd.h @@ -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 */ diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index b4bac840e..6e17d778a 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -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) |