From: Donald Sharp Date: Sat, 21 Apr 2018 23:59:25 +0000 (-0400) Subject: bgpd: The deletion of a bgp route does not need to send some data X-Git-Tag: frr-5.0-dev~24^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F2103%2Fhead;p=mirror%2Ffrr.git bgpd: The deletion of a bgp route does not need to send some data 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 --- diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index b564fccf43..1c32291740 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -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];