summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_clist.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_clist.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_clist.c')
-rw-r--r--bgpd/bgp_clist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index f3bae9535..72b1098ed 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -438,7 +438,7 @@ static int community_regexp_match(struct community *com, regex_t *reg)
if (com == NULL || com->size == 0)
str = "";
else
- str = community_str(com);
+ str = community_str(com, false);
/* Regular expression match. */
if (regexec(reg, str, 0, NULL, 0) == 0)