Skip to content

Commit

Permalink
bgpd: fix install BGP route with appropriate colored ext. community
Browse files Browse the repository at this point in the history
When receiving a BGP update that includes a colored extended community,
the nexthop is tracked in the bgp nexthop tracking context, but the
color is never recorded. Adding to this, the BGP route is not prevented
from being installed without hte color.

Actually, the srte color is set only when the SRTE_COLOR attribute is set.
And that attribute value is only set when an ext. community is locally
created, or an srte value is set, but not when a BGP update with a color
ext. community is received.

Fix this by setting the SRTE_COLOR attribute on this last case.

Fixes: 442e2ed ("bgpd: add functions related to srte_color management")

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Mar 21, 2024
1 parent 08c56b4 commit ce258a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bgpd/bgp_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,10 @@ static inline void bgp_attr_set_community(struct attr *attr,
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES));
else
UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES));

if (ecommunity_select_color(attr->ecommunity))
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_SRTE_COLOR));

}

static inline struct ecommunity *
Expand Down

0 comments on commit ce258a5

Please sign in to comment.