]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: lcommunity: fix minor issues
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 25 Jan 2017 21:33:29 +0000 (22:33 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 25 Jan 2017 21:35:03 +0000 (22:35 +0100)
- 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 <equinox@opensourcerouting.org>
bgpd/bgp_route.c
bgpd/bgp_routemap.c

index afcf05d2b3c62180b2725d593b7b5a52c873bb74..06584cf681cb98383b5a6ba724304c8cdf286f1b 100644 (file)
@@ -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;
index 58d9b20f908febf644311be2cc5b518e25cc030c..a3c61e21558d846944953b6696b1a77f70120d63 100644 (file)
@@ -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);
     }