From 9b1be336fabce8de6460f02b937740ba553d5267 Mon Sep 17 00:00:00 2001 From: Daniel Walton Date: Thu, 14 Jan 2016 15:25:32 +0000 Subject: [PATCH] BGP: ebgp-multihop should accept a value up to 255 Signed-off-by: Daniel Walton Reviewed-by: Donald Sharp Reviewed-by: Don Slice Ticket: CM-8788 --- bgpd/bgp_vty.c | 8 ++++---- bgpd/bgpd.c | 8 ++++---- bgpd/bgpd.h | 3 --- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 9b70c418e3..62827dad28 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -4283,9 +4283,9 @@ peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str, return CMD_WARNING; if (! ttl_str) - ttl = TTL_MAX; + ttl = MAXTTL; else - VTY_GET_INTEGER_RANGE ("TTL", ttl, ttl_str, 1, 255); + VTY_GET_INTEGER_RANGE ("TTL", ttl, ttl_str, 1, MAXTTL); return bgp_vty_return (vty, peer_ebgp_multihop_set (peer, ttl)); } @@ -4315,7 +4315,7 @@ DEFUN (neighbor_ebgp_multihop, DEFUN (neighbor_ebgp_multihop_ttl, neighbor_ebgp_multihop_ttl_cmd, - NEIGHBOR_CMD2 "ebgp-multihop " CMD_RANGE_STR(1, MULTIPATH_NUM), + NEIGHBOR_CMD2 "ebgp-multihop " CMD_RANGE_STR(1, MAXTTL), NEIGHBOR_STR NEIGHBOR_ADDR_STR2 "Allow EBGP neighbors not on directly connected networks\n" @@ -4337,7 +4337,7 @@ DEFUN (no_neighbor_ebgp_multihop, ALIAS (no_neighbor_ebgp_multihop, no_neighbor_ebgp_multihop_ttl_cmd, - NO_NEIGHBOR_CMD2 "ebgp-multihop " CMD_RANGE_STR(1, MULTIPATH_NUM), + NO_NEIGHBOR_CMD2 "ebgp-multihop " CMD_RANGE_STR(1, MAXTTL), NO_STR NEIGHBOR_STR NEIGHBOR_ADDR_STR2 diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index af05acd90a..af2f284dab 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -822,7 +822,7 @@ peer_global_config_reset (struct peer *peer) peer->weight = 0; peer->change_local_as = 0; - peer->ttl = (peer_sort (peer) == BGP_PEER_IBGP ? 255 : 1); + peer->ttl = (peer_sort (peer) == BGP_PEER_IBGP ? MAXTTL : 1); if (peer->update_source) { sockunion_free (peer->update_source); @@ -1417,7 +1417,7 @@ peer_create (union sockunion *su, const char *conf_if, struct bgp *bgp, peer->readtime = peer->resettime = bgp_clock (); /* Default TTL set. */ - peer->ttl = (peer->sort == BGP_PEER_IBGP) ? 255 : 1; + peer->ttl = (peer->sort == BGP_PEER_IBGP) ? MAXTTL : 1; SET_FLAG (peer->flags, PEER_FLAG_CONFIG_NODE); @@ -1498,7 +1498,7 @@ peer_as_change (struct peer *peer, as_t as, int as_specified) } /* TTL reset */ if (peer_sort (peer) == BGP_PEER_IBGP) - peer->ttl = 255; + peer->ttl = MAXTTL; else if (type == BGP_PEER_IBGP) peer->ttl = 1; @@ -2563,7 +2563,7 @@ peer_group_bind (struct bgp *bgp, union sockunion *su, struct peer *peer, /* ebgp-multihop reset */ if (peer_sort (group->conf) == BGP_PEER_IBGP) - group->conf->ttl = 255; + group->conf->ttl = MAXTTL; /* local-as reset */ if (peer_sort (group->conf) != BGP_PEER_EBGP) diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index c8bdb3f92d..14ebf840ab 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1008,9 +1008,6 @@ struct bgp_nlri /* RFC4364 */ #define SAFI_MPLS_LABELED_VPN 128 -/* Max TTL value. */ -#define TTL_MAX 255 - /* BGP uptime string length. */ #define BGP_UPTIME_LEN 25 -- 2.39.5