summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_attr.h
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-04-12 10:06:52 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-04-12 21:09:28 +0200
commit58cf5c088a44a2e74eb625d1b6fe2bc8e31638ce (patch)
tree06e6c18bd765e6d5fcacd60445d0853477a8f233 /bgpd/bgp_attr.h
parentbgpd: Reuse bgp_attr_set_[l]community() for setting attribute flags (diff)
downloadfrr-58cf5c088a44a2e74eb625d1b6fe2bc8e31638ce.tar.xz
frr-58cf5c088a44a2e74eb625d1b6fe2bc8e31638ce.zip
bgpd: Reuse bgp_attr_set_ecommunity() for setting attribute flags
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_attr.h')
-rw-r--r--bgpd/bgp_attr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index 49702a0e3..4ed0ca5e7 100644
--- a/bgpd/bgp_attr.h
+++ b/bgpd/bgp_attr.h
@@ -516,6 +516,11 @@ static inline void bgp_attr_set_ecommunity(struct attr *attr,
struct ecommunity *ecomm)
{
attr->ecommunity = ecomm;
+
+ if (ecomm)
+ SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
+ else
+ UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
}
static inline struct lcommunity *
@@ -562,6 +567,13 @@ static inline void bgp_attr_set_ipv6_ecommunity(struct attr *attr,
struct ecommunity *ipv6_ecomm)
{
attr->ipv6_ecommunity = ipv6_ecomm;
+
+ if (ipv6_ecomm)
+ SET_FLAG(attr->flag,
+ ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
+ else
+ UNSET_FLAG(attr->flag,
+ ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
}
static inline struct transit *bgp_attr_get_transit(const struct attr *attr)