Skip to content

Commit

Permalink
bgpd: Modify attr->flag to be 64 bit
Browse files Browse the repository at this point in the history
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 <sharpd@cumulusnetworks.com>
  • Loading branch information
donaldsharp committed Apr 6, 2017
1 parent 28d58fd commit 02cd945
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bgpd/bgp_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) ? \
Expand Down

0 comments on commit 02cd945

Please sign in to comment.