/*
* 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;
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 */
#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;
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)