summaryrefslogtreecommitdiffstats
path: root/bgpd/bgpd.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2019-11-27 09:48:17 +0100
committerDonatas Abraitis <donatas.abraitis@gmail.com>2019-11-27 09:48:17 +0100
commitc8d6f0d6c4b4689251d66a8e6ed54d4fd2d3a9d9 (patch)
treec5e23dcd5825ef79cc74aa56c6479bc9ee54b0f7 /bgpd/bgpd.c
parentMerge pull request #5419 from adharkar/frr-master-nh_connected (diff)
downloadfrr-c8d6f0d6c4b4689251d66a8e6ed54d4fd2d3a9d9.tar.xz
frr-c8d6f0d6c4b4689251d66a8e6ed54d4fd2d3a9d9.zip
bgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL
For readability and maintainability purposes. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgpd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index d4e60b409..a74923c30 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -6557,16 +6557,17 @@ int is_ebgp_multihop_configured(struct peer *peer)
if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
group = peer->group;
if ((peer_sort(peer) != BGP_PEER_IBGP)
- && (group->conf->ttl != 1))
+ && (group->conf->ttl != BGP_DEFAULT_TTL))
return 1;
for (ALL_LIST_ELEMENTS(group->peer, node, nnode, peer1)) {
if ((peer_sort(peer1) != BGP_PEER_IBGP)
- && (peer1->ttl != 1))
+ && (peer1->ttl != BGP_DEFAULT_TTL))
return 1;
}
} else {
- if ((peer_sort(peer) != BGP_PEER_IBGP) && (peer->ttl != 1))
+ if ((peer_sort(peer) != BGP_PEER_IBGP)
+ && (peer->ttl != BGP_DEFAULT_TTL))
return 1;
}
return 0;
@@ -7109,7 +7110,7 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
vty_out(vty, " neighbor %s passive\n", addr);
/* ebgp-multihop */
- if (peer->sort != BGP_PEER_IBGP && peer->ttl != 1
+ if (peer->sort != BGP_PEER_IBGP && peer->ttl != BGP_DEFAULT_TTL
&& !(peer->gtsm_hops != 0 && peer->ttl == MAXTTL)) {
if (!peer_group_active(peer) || g_peer->ttl != peer->ttl) {
vty_out(vty, " neighbor %s ebgp-multihop %d\n", addr,