]> git.puffer.fish Git - mirror/frr.git/commitdiff
BGP: ebgp-multihop should accept a value up to 255
authorDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 14 Jan 2016 15:25:32 +0000 (15:25 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 14 Jan 2016 15:25:32 +0000 (15:25 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-8788

bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h

index 9b70c418e3baf1f08a2ed74c96cc88d9cc509e3c..62827dad289cdd506cf2371fb546089a3f51f3c0 100644 (file)
@@ -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
index af05acd90a011a7f304c700e9d79e6e45dcd542d..af2f284dab50698ad20c6a9026741dd959edc528 100644 (file)
@@ -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)
index c8bdb3f92d2dd8800b384e5acf710feb853eeb6b..14ebf840ab24942d1fb7f7d4ea771c45f40a14d5 100644 (file)
@@ -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