From: Donald Sharp Date: Thu, 17 Dec 2020 21:49:20 +0000 (-0500) Subject: bgpd: Remove awful test of strmatch + get_afi_safi_str X-Git-Tag: base_7.6~111^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d6bbfefe145edbfff42732e9f4f3bdf6653cb4b8;p=mirror%2Ffrr.git bgpd: Remove awful test of strmatch + get_afi_safi_str Remove awful test of a strmatch against a call to get_afi_safi_str. These are the easy ones as that the real decision point is/was underneath this test. This is just duplicate expensive testing. Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_conditional_adv.c b/bgpd/bgp_conditional_adv.c index 6755def8bc..b9ea26e862 100644 --- a/bgpd/bgp_conditional_adv.c +++ b/bgpd/bgp_conditional_adv.c @@ -197,10 +197,6 @@ static int bgp_conditional_adv_timer(struct thread *t) continue; FOREACH_AFI_SAFI (afi, safi) { - if (strmatch(get_afi_safi_str(afi, safi, true), - "Unknown")) - continue; - if (!peer->afc_nego[afi][safi]) continue; diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 22c576d90f..60ad8d20e9 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -11739,10 +11739,6 @@ DEFPY (show_ip_bgp_json, ? AFI_IP : AFI_IP6; FOREACH_SAFI (safi) { - if (strmatch(get_afi_safi_str(afi, safi, true), - "Unknown")) - continue; - if (!bgp_afi_safi_peer_exists(bgp, afi, safi)) continue; @@ -11773,10 +11769,6 @@ DEFPY (show_ip_bgp_json, } else { /* show bgp all: for each AFI and SAFI*/ FOREACH_AFI_SAFI (afi, safi) { - if (strmatch(get_afi_safi_str(afi, safi, true), - "Unknown")) - continue; - if (!bgp_afi_safi_peer_exists(bgp, afi, safi)) continue; @@ -13318,10 +13310,6 @@ DEFPY (show_ip_bgp_instance_neighbor_advertised_route, afi = CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_IP) ? AFI_IP : AFI_IP6; FOREACH_SAFI (safi) { - if (strmatch(get_afi_safi_str(afi, safi, true), - "Unknown")) - continue; - if (!bgp_afi_safi_peer_exists(bgp, afi, safi)) continue; @@ -13341,10 +13329,6 @@ DEFPY (show_ip_bgp_instance_neighbor_advertised_route, } } else { FOREACH_AFI_SAFI (afi, safi) { - if (strmatch(get_afi_safi_str(afi, safi, true), - "Unknown")) - continue; - if (!bgp_afi_safi_peer_exists(bgp, afi, safi)) continue;