Merge pull request #15782 from opensourcerouting/fix/drop_srte_color_flag

bgpd: Drop SRTE_COLOR attribute flag
This commit is contained in:
Russ White 2024-04-27 08:19:09 -04:00 committed by GitHub
commit 1a9c3a710d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 18 deletions

View file

@ -517,11 +517,9 @@ 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));
if (ecommunity_select_color(ecomm))
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR));
} else
else
UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
}

View file

@ -357,8 +357,6 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,
return 0;
}
if (CHECK_FLAG(pi->attr->flag,
ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR)))
srte_color = bgp_attr_get_color(pi->attr);
} else if (peer) {

View file

@ -1944,7 +1944,6 @@ route_set_srte_color(void *rule, const struct prefix *prefix, void *object)
path = object;
path->attr->srte_color = *srte_color;
path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR);
return RMAP_OKAY;
}
@ -3338,13 +3337,8 @@ static enum route_map_cmd_result_t
route_set_ecommunity_color(void *rule, const struct prefix *prefix,
void *object)
{
struct bgp_path_info *path;
path = object;
route_set_ecommunity(rule, prefix, object);
path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR);
return RMAP_OKAY;
}

View file

@ -1308,8 +1308,6 @@ static void bgp_zebra_announce_parse_nexthop(
else
api_nh = &api->backup_nexthops[*valid_nh_count];
if (CHECK_FLAG(info->attr->flag,
ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR)))
api_nh->srte_color = bgp_attr_get_color(info->attr);
if (bgp_debug_zebra(&api->prefix)) {
@ -1582,7 +1580,7 @@ bgp_zebra_announce_actual(struct bgp_dest *dest, struct bgp_path_info *info,
api.tableid = info->attr->rmap_table_id;
}
if (CHECK_FLAG(info->attr->flag, ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR)))
if (info->attr->srte_color)
SET_FLAG(api.message, ZAPI_MESSAGE_SRTE);
/* Metric is currently based on the best-path only */

View file

@ -1974,7 +1974,6 @@ struct bgp_nlri {
#define BGP_ATTR_LARGE_COMMUNITIES 32
#define BGP_ATTR_OTC 35
#define BGP_ATTR_PREFIX_SID 40
#define BGP_ATTR_SRTE_COLOR 51
#ifdef ENABLE_BGP_VNC_ATTR
#define BGP_ATTR_VNC 255
#endif