summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_routemap.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-04-11 17:09:35 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-04-12 21:09:28 +0200
commit9d34440bf811a14d9dd47972b1c24428f18ff6b4 (patch)
tree3a04e82903a1c182f2ceceb10625eee5bd361679 /bgpd/bgp_routemap.c
parentMerge pull request #10994 from opensourcerouting/fix/autocomplete_for_adverti... (diff)
downloadfrr-9d34440bf811a14d9dd47972b1c24428f18ff6b4.tar.xz
frr-9d34440bf811a14d9dd47972b1c24428f18ff6b4.zip
bgpd: Reuse bgp_attr_set_[l]community() for setting attribute flags
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_routemap.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 2ed73ddb6..df92a24ce 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2199,7 +2199,6 @@ route_set_community(void *rule, const struct prefix *prefix, void *object)
/* "none" case. */
if (rcs->none) {
- attr->flag &= ~(ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES));
bgp_attr_set_community(attr, NULL);
/* See the longer comment down below. */
if (old && old->refcnt == 0)
@@ -2227,8 +2226,6 @@ route_set_community(void *rule, const struct prefix *prefix, void *object)
/* will be interned by caller if required */
bgp_attr_set_community(attr, new);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
-
return RMAP_OKAY;
}
@@ -2313,7 +2310,6 @@ route_set_lcommunity(void *rule, const struct prefix *prefix, void *object)
/* "none" case. */
if (rcs->none) {
- attr->flag &= ~(ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES));
bgp_attr_set_lcommunity(attr, NULL);
/* See the longer comment down below. */
@@ -2341,8 +2337,6 @@ route_set_lcommunity(void *rule, const struct prefix *prefix, void *object)
/* will be intern()'d or attr_flush()'d by bgp_update_main() */
bgp_attr_set_lcommunity(attr, new);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
-
return RMAP_OKAY;
}
@@ -2438,13 +2432,9 @@ route_set_lcommunity_delete(void *rule, const struct prefix *pfx, void *object)
if (new->size == 0) {
bgp_attr_set_lcommunity(path->attr, NULL);
- path->attr->flag &=
- ~ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
lcommunity_free(&new);
} else {
bgp_attr_set_lcommunity(path->attr, new);
- path->attr->flag |=
- ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
}
}
@@ -2526,12 +2516,9 @@ route_set_community_delete(void *rule, const struct prefix *prefix,
if (new->size == 0) {
bgp_attr_set_community(path->attr, NULL);
- path->attr->flag &=
- ~ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
community_free(&new);
} else {
bgp_attr_set_community(path->attr, new);
- path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
}
}