]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: The deletion of a bgp route does not need to send some data 2103/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 21 Apr 2018 23:59:25 +0000 (19:59 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 22 Apr 2018 00:08:16 +0000 (20:08 -0400)
When sending a bgp route down to zebra for deletion, the
ZEBRA_FLAG_ALLOW_RECURSION and ZEBRA_FLAG_IBGP flags
are not needed in zebra.  So remove the setting
of the api.flags.  If we remove this data from being
passed down we no longer need the peer data structure.

Remove the lookup of the peer data structure and the setting
of the flags as that peer was NULL in some evpn symmetric
routing cases for shutdown of bgp.

Ticket: CM-20720
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_zebra.c

index b564fccf436bf014e42f9507e63913dff36f7f81..1c3229174049ff1112f7dca7775f03e90a622d0b 100644 (file)
@@ -1379,25 +1379,6 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info,
                        struct bgp *bgp, safi_t safi)
 {
        struct zapi_route api;
-       struct peer *peer;
-
-       peer = info->peer;
-       assert(peer);
-
-       if (info->type == ZEBRA_ROUTE_BGP
-           && info->sub_type == BGP_ROUTE_IMPORTED) {
-
-               struct bgp_info *bi;
-
-               /*
-                * Look at parent chain for peer sort
-                */
-               for (bi = info; bi->extra && bi->extra->parent;
-                    bi = bi->extra->parent) {
-
-                       peer = ((struct bgp_info *)(bi->extra->parent))->peer;
-               }
-       }
 
        /* Don't try to install if we're not connected to Zebra or Zebra doesn't
         * know of this instance.
@@ -1416,16 +1397,6 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info,
        if (is_route_parent_evpn(info))
                SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE);
 
-       if (peer->sort == BGP_PEER_IBGP) {
-               SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION);
-               SET_FLAG(api.flags, ZEBRA_FLAG_IBGP);
-       }
-
-       if ((peer->sort == BGP_PEER_EBGP && peer->ttl != 1)
-           || CHECK_FLAG(peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK)
-           || bgp_flag_check(bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK))
-               SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION);
-
        if (bgp_debug_zebra(p)) {
                char buf[PREFIX_STRLEN];