]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Remove redundant checks in bgp_zebra_announce()
authorDonald Sharp <sharpd@nvidia.com>
Thu, 7 Jan 2021 23:54:34 +0000 (18:54 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 7 Jan 2021 23:54:34 +0000 (18:54 -0500)
BGP has created some redundant checks in bgp_zebra_announce()
Reduce the multiple if statements and consolidate a bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_zebra.c

index 67745a965363be83bdd439586c93978f68f51707..5d663027b609c13d7424b00004bf260d39eca984 100644 (file)
@@ -1326,9 +1326,6 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
                                   apply doesn't modify the BGP route info. */
                                local_attr = *mpinfo->attr;
                                mpinfo_cp->attr = &local_attr;
-                       }
-
-                       if (bgp->table_map[afi][safi].name) {
                                if (!bgp_table_map_apply(
                                            bgp->table_map[afi][safi].map, p,
                                            mpinfo_cp))
@@ -1352,13 +1349,6 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
                        ifindex_t ifindex = IFINDEX_INTERNAL;
                        struct in6_addr *nexthop;
 
-                       if (bgp->table_map[afi][safi].name) {
-                               /* Copy info and attributes, so the route-map
-                                  apply doesn't modify the BGP route info. */
-                               local_attr = *mpinfo->attr;
-                               mpinfo_cp->attr = &local_attr;
-                       }
-
                        if (bgp->table_map[afi][safi].name) {
                                /* Copy info and attributes, so the route-map
                                   apply doesn't modify the BGP route info. */