summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_debug.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-11-17 02:43:56 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-11-17 15:04:26 +0100
commita69ea8aeac9d6cc5c27c084d02a0ddcd96231e46 (patch)
tree88399c020efd0d768e90865bf2da3cc9f92c149c /bgpd/bgp_debug.c
parentbgpd: Only create json for aspath if needed (diff)
downloadfrr-a69ea8aeac9d6cc5c27c084d02a0ddcd96231e46.tar.xz
frr-a69ea8aeac9d6cc5c27c084d02a0ddcd96231e46.zip
bgpd: Only build json for community when needed
Building a communities json object every time is both expensive and memory wasteful. Modify code to only build the json object when needed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r--bgpd/bgp_debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 6e16d5f45..45ac8e685 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -385,7 +385,8 @@ int 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(attr->community));
+ ", community %s", community_str(attr->community,
+ false));
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)))
snprintf(buf + strlen(buf), size - strlen(buf),