]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Drop SRTE_COLOR attribute flag 15782/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 17 Apr 2024 19:25:29 +0000 (22:25 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 17 Apr 2024 19:50:44 +0000 (22:50 +0300)
SRTE_COLOR is not defined at all as an attribute, it was a mistake from the
beginning.

SRTE_COLOR is extended community, can't see the reason having it as a community,
and a separate attribute.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_attr.h
bgpd/bgp_nht.c
bgpd/bgp_routemap.c
bgpd/bgp_zebra.c
bgpd/bgpd.h

index 164aa5ae795098fa0f4f64b9d9a5f86f894835f6..5386f24a0bacc32dfade24d1b5d055a496322829 100644 (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));
 }
 
index 80ec9bcf773073e806d91d27ff3cde425df0b520..4734d542e5bbc9a0648405a58d9cda352627a69d 100644 (file)
@@ -357,9 +357,7 @@ 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);
+               srte_color = bgp_attr_get_color(pi->attr);
 
        } else if (peer) {
                /*
index 15828b65946563e1dc209ddae6a11f38b12ee0fb..a4abee479fbdd8ef583514a3f024485b305fcfa1 100644 (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;
 }
@@ -3317,13 +3316,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;
 }
 
index 9a819657734e4b9ebb643b35c376c052632428d6..debf146a05e7761b420e769046f1f9eefbb119a6 100644 (file)
@@ -1308,9 +1308,7 @@ 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);
+               api_nh->srte_color = bgp_attr_get_color(info->attr);
 
                if (bgp_debug_zebra(&api->prefix)) {
                        if (mpinfo->extra) {
@@ -1581,7 +1579,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 */
index e882a181b50ceac91eae152d98be9ac347974dd2..42c026f9d3b9f61c40327d7d9bc80f2bed99ce9c 100644 (file)
@@ -1971,7 +1971,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