diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index 213de45c5597..a8ca8c1fa638 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -353,7 +353,7 @@ struct transit { __builtin_choose_expr((X) >= 1 && (X) <= 64, 1ULL << ((X)-1), (void)0) #define BGP_CLUSTER_LIST_LENGTH(attr) \ - (((attr)->flag & ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST)) \ + (CHECK_FLAG((attr)->flag, ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST)) \ ? bgp_attr_get_cluster((attr))->length \ : 0) diff --git a/bgpd/bgp_attr_evpn.c b/bgpd/bgp_attr_evpn.c index fc7548d9bf50..a3ffe61eb8cb 100644 --- a/bgpd/bgp_attr_evpn.c +++ b/bgpd/bgp_attr_evpn.c @@ -218,7 +218,8 @@ uint32_t bgp_attr_mac_mobility_seqnum(struct attr *attr) continue; flags = *pnt++; - if (flags & ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY_FLAG_STICKY) + if (CHECK_FLAG(flags, + ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY_FLAG_STICKY)) SET_FLAG(attr->evpn_flags, ATTR_EVPN_FLAG_STICKY); else UNSET_FLAG(attr->evpn_flags, ATTR_EVPN_FLAG_STICKY); @@ -258,11 +259,12 @@ void bgp_attr_evpn_na_flag(struct attr *attr, bool *proxy) sub_type == ECOMMUNITY_EVPN_SUBTYPE_ND) { val = *pnt++; - if (val & ECOMMUNITY_EVPN_SUBTYPE_ND_ROUTER_FLAG) + if (CHECK_FLAG(val, + ECOMMUNITY_EVPN_SUBTYPE_ND_ROUTER_FLAG)) SET_FLAG(attr->evpn_flags, ATTR_EVPN_FLAG_ROUTER); - if (val & ECOMMUNITY_EVPN_SUBTYPE_PROXY_FLAG) + if (CHECK_FLAG(val, ECOMMUNITY_EVPN_SUBTYPE_PROXY_FLAG)) *proxy = true; break; diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 44a4c0f00be3..556738a606dd 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -2543,9 +2543,9 @@ DEFPY(bmp_monitor_cfg, bmp_monitor_cmd, prev = bt->afimon[afi][safi]; if (no) - bt->afimon[afi][safi] &= ~flag; + UNSET_FLAG(bt->afimon[afi][safi], flag); else - bt->afimon[afi][safi] |= flag; + SET_FLAG(bt->afimon[afi][safi], flag); if (prev == bt->afimon[afi][safi]) return CMD_SUCCESS; diff --git a/bgpd/bgp_btoa.c b/bgpd/bgp_btoa.c index 1d5034efd258..32823cc37664 100644 --- a/bgpd/bgp_btoa.c +++ b/bgpd/bgp_btoa.c @@ -69,7 +69,7 @@ static void attr_parse(struct stream *s, uint16_t len) flag = stream_getc(s); type = stream_getc(s); - if (flag & BGP_ATTR_FLAG_EXTLEN) + if (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN)) length = stream_getw(s); else length = stream_getc(s);