diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index 5386f24a0bac..164aa5ae7950 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -517,9 +517,11 @@ static inline void bgp_attr_set_ecommunity(struct attr *attr, { attr->ecommunity = ecomm; - if (ecomm) + if (ecomm) { SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)); - else + if (ecommunity_select_color(ecomm)) + SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR)); + } else UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)); }