From: Louis Scalbert Date: Tue, 5 Jul 2022 13:22:12 +0000 (+0200) Subject: bgpd: fix prefix VRF leaking with 'network import-check' (3/5) X-Git-Tag: base_8.5~109^2~19 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d0a55f87e9cd4d67e9514f31cfe589eeaec0ed4a;p=matthieu%2Ffrr.git bgpd: fix prefix VRF leaking with 'network import-check' (3/5) "if not XX else" statements are confusing. Replace two "if not XX else" statements by "if XX else" to prepare next commits. The patch is only cosmetic. Signed-off-by: Louis Scalbert --- diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index cf8ff524e9..78482aeb40 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -858,24 +858,22 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id) tree = &bgp->nexthop_cache_table[afi]; bnc_nhc = bnc_find(tree, &match, nhr.srte_color, 0); - if (!bnc_nhc) { - if (BGP_DEBUG(nht, NHT)) - zlog_debug( - "parse nexthop update(%pFX(%u)(%s)): bnc info not found for nexthop cache", - &nhr.prefix, nhr.srte_color, bgp->name_pretty); - } else + if (bnc_nhc) bgp_process_nexthop_update(bnc_nhc, &nhr, false); + else if (BGP_DEBUG(nht, NHT)) + zlog_debug( + "parse nexthop update(%pFX(%u)(%s)): bnc info not found for nexthop cache", + &nhr.prefix, nhr.srte_color, bgp->name_pretty); tree = &bgp->import_check_table[afi]; bnc_import = bnc_find(tree, &match, nhr.srte_color, 0); - if (!bnc_import) { - if (BGP_DEBUG(nht, NHT)) - zlog_debug( - "parse nexthop update(%pFX(%u)(%s)): bnc info not found for import check", - &nhr.prefix, nhr.srte_color, bgp->name_pretty); - } else + if (bnc_import) bgp_process_nexthop_update(bnc_import, &nhr, true); + else if (BGP_DEBUG(nht, NHT)) + zlog_debug( + "parse nexthop update(%pFX(%u)(%s)): bnc info not found for import check", + &nhr.prefix, nhr.srte_color, bgp->name_pretty); /* * HACK: if any BGP route is dependant on an SR-policy that doesn't