summaryrefslogtreecommitdiff
path: root/bgpd/bgp_zebra.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2019-11-27 07:18:21 -0500
committerGitHub <noreply@github.com>2019-11-27 07:18:21 -0500
commit6b88cae109f767a0796bd63604f06f01706f45cc (patch)
treeb17aae16171f575f8c8e09c0505a51d0f3dc6197 /bgpd/bgp_zebra.c
parentbdd2a9315eaa679227a775505719583e13f84fdb (diff)
parentc8d6f0d6c4b4689251d66a8e6ed54d4fd2d3a9d9 (diff)
Merge pull request #5437 from ton31337/fix/replace_magic_number_to_readable
bgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r--bgpd/bgp_zebra.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 790d350697..e886733ced 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -278,12 +278,14 @@ static int bgp_ifp_down(struct interface *ifp)
* 1-hop BFD
* tracked (directly connected) IBGP peers.
*/
- if ((peer->ttl != 1) && (peer->gtsm_hops != 1)
+ if ((peer->ttl != BGP_DEFAULT_TTL)
+ && (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))
+ if ((peer->ttl != BGP_DEFAULT_TTL)
+ && (peer->gtsm_hops != 1))
#endif
continue;
@@ -448,7 +450,8 @@ static int bgp_interface_vrf_update(ZAPI_CALLBACK_ARGS)
/* Fast external-failover */
if (!CHECK_FLAG(bgp->flags, BGP_FLAG_NO_FAST_EXT_FAILOVER)) {
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
- if ((peer->ttl != 1) && (peer->gtsm_hops != 1))
+ if ((peer->ttl != BGP_DEFAULT_TTL)
+ && (peer->gtsm_hops != 1))
continue;
if (ifp == peer->nexthop.ifp)
@@ -1222,7 +1225,7 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION);
}
- if ((peer->sort == BGP_PEER_EBGP && peer->ttl != 1)
+ if ((peer->sort == BGP_PEER_EBGP && peer->ttl != BGP_DEFAULT_TTL)
|| CHECK_FLAG(peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK)
|| bgp_flag_check(bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK))