diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-04-08 21:57:47 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-04-09 16:34:06 +0200 |
commit | c0945b78286ae88644e6e423b1b4ef0d783d1063 (patch) | |
tree | 4e3c3db551e47481230722cf6c896059abef8d9c /bgpd/bgp_debug.c | |
parent | Merge pull request #10981 from opensourcerouting/vty-wrmem-newline (diff) | |
download | frr-c0945b78286ae88644e6e423b1b4ef0d783d1063.tar.xz frr-c0945b78286ae88644e6e423b1b4ef0d783d1063.zip |
bgpd: Allow setting BGP [large]community in route-maps
Before:
```
spine1-debian-11(config-route-map)# bgp community alias 65001:65001 test1
spine1-debian-11(config)# route-map rm permit 10
spine1-debian-11(config-route-map)# set community 65001:65001
% Malformed communities attribute
```
After:
```
spine1-debian-11(config)# bgp community alias 65001:65001 test1
spine1-debian-11(config)# route-map rm permit 10
spine1-debian-11(config-route-map)# set community 65001:65001
spine1-debian-11(config-route-map)#
```
Same for large-communities.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r-- | bgpd/bgp_debug.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index 5d14ff0fa..49003e942 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -411,12 +411,14 @@ bool bgp_dump_attr(struct attr *attr, char *buf, size_t size) if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES))) snprintf(buf + strlen(buf), size - strlen(buf), ", community %s", - community_str(bgp_attr_get_community(attr), false)); + community_str(bgp_attr_get_community(attr), false, + true)); if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES))) snprintf(buf + strlen(buf), size - strlen(buf), ", large-community %s", - lcommunity_str(bgp_attr_get_lcommunity(attr), false)); + lcommunity_str(bgp_attr_get_lcommunity(attr), false, + true)); if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES))) snprintf(buf + strlen(buf), size - strlen(buf), |