From: David Lamparter Date: Wed, 25 Jan 2017 21:33:29 +0000 (+0100) Subject: bgpd: lcommunity: fix minor issues X-Git-Tag: frr-3.0-branchpoint~64^2~5^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ed165abf905e10b7d8b9b9989c52d9a405c513f1;p=mirror%2Ffrr.git bgpd: lcommunity: fix minor issues - route_set_lcommunity would do nothing (and leak memory) if attr->extra wasn't up yet - an if() arch in bgp_show_table() was duplicated (with no effect) Signed-off-by: David Lamparter --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index afcf05d2b3..06584cf681 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7426,11 +7426,6 @@ bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table, if (! community_list_exact_match (ri->attr->community, list)) continue; } - if (type == bgp_show_type_community_all) - { - if (! ri->attr->community) - continue; - } if (type == bgp_show_type_lcommunity) { struct lcommunity *lcom = output_arg; diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 58d9b20f90..a3c61e2155 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -1676,9 +1676,8 @@ route_set_lcommunity (void *rule, struct prefix *prefix, else new = lcommunity_dup (rcs->lcom); - /* will be interned by caller if required */ - if (attr->extra) - attr->extra->lcommunity = new; + /* will be intern()'d or attr_flush()'d by bgp_update_main() */ + (bgp_attr_extra_get (attr))->lcommunity = new; attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES); }