]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Replace 65535 with UINT16_MAX 8001/head
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 2 Feb 2021 08:28:18 +0000 (10:28 +0200)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 2 Feb 2021 13:31:12 +0000 (15:31 +0200)
Just consistent.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_aspath.h
bgpd/bgp_attr.c
bgpd/bgpd.c

index 9df352fcd6a234a4356cb78de6161dfdd3503157..4b1681816795868c32c2ccf3923de6001d2be10a 100644 (file)
@@ -32,7 +32,7 @@
 
 /* Private AS range defined in RFC2270.  */
 #define BGP_PRIVATE_AS_MIN       64512U
-#define BGP_PRIVATE_AS_MAX       65535U
+#define BGP_PRIVATE_AS_MAX UINT16_MAX
 
 /* Private 4 byte AS range defined in RFC6996.  */
 #define BGP_PRIVATE_AS4_MIN     4200000000U
@@ -40,7 +40,7 @@
 
 /* we leave BGP_AS_MAX as the 16bit AS MAX number.  */
 #define BGP_AS_ZERO                      0
-#define BGP_AS_MAX                  65535U
+#define BGP_AS_MAX UINT16_MAX
 #define BGP_AS4_MAX            4294967295U
 /* Transition 16Bit AS as defined by IANA */
 #define BGP_AS_TRANS            23456U
index c25d0e269a7b42dc09299d90d080c024dfb2d7dd..880d1cd8b65a8b8e8ff1fedba39fdea16a958d32 100644 (file)
@@ -3901,7 +3901,7 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
 
                        /* Is ASN representable in 2-bytes? Or must AS_TRANS be
                         * used? */
-                       if (attr->aggregator_as > 65535) {
+                       if (attr->aggregator_as > UINT16_MAX) {
                                stream_putw(s, BGP_AS_TRANS);
 
                                /* we have to send AS4_AGGREGATOR, too.
index edd90d7040351cbd6a441f9cb62119b40ba1f74c..37403ccffd50ca5f8195dbaf04e310b5bb480a56 100644 (file)
@@ -5216,10 +5216,10 @@ int peer_timers_set(struct peer *peer, uint32_t keepalive, uint32_t holdtime)
        struct peer *member;
        struct listnode *node, *nnode;
 
-       if (keepalive > 65535)
+       if (keepalive > UINT16_MAX)
                return BGP_ERR_INVALID_VALUE;
 
-       if (holdtime > 65535)
+       if (holdtime > UINT16_MAX)
                return BGP_ERR_INVALID_VALUE;
 
        if (holdtime < 3 && holdtime != 0)
@@ -5296,7 +5296,7 @@ int peer_timers_connect_set(struct peer *peer, uint32_t connect)
        struct peer *member;
        struct listnode *node, *nnode;
 
-       if (connect > 65535)
+       if (connect > UINT16_MAX)
                return BGP_ERR_INVALID_VALUE;
 
        /* Set flag and configuration on peer. */