From 02cd9458d6de1c86f8cd1f6f08406348d2994486 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 10 Mar 2017 07:59:52 -0500 Subject: [PATCH] bgpd: Modify attr->flag to be 64 bit With the some current bgp drafts the Attribute number has surpassed 32. Which is a bit unfortunate in that we keep track of the attributes via a bitfield based on the attribute #. For the moment since I am not aware of Attribute #'s being greater than 64, convert the flag to 64 bit and allow the bit shifting to know about it. Signed-off-by: Donald Sharp --- bgpd/bgp_attr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index 310fc0215d..e0dac354fb 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -163,7 +163,7 @@ struct attr unsigned long refcnt; /* Flag of attribute is set or not. */ - u_int32_t flag; + u_int64_t flag; /* Apart from in6_addr, the remaining static attributes */ struct in_addr nexthop; @@ -204,7 +204,7 @@ struct transit u_char *val; }; -#define ATTR_FLAG_BIT(X) (1 << ((X) - 1)) +#define ATTR_FLAG_BIT(X) (1ULL << ((X) - 1)) #define BGP_CLUSTER_LIST_LENGTH(attr) \ (((attr)->flag & ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST)) ? \ -- 2.39.5