summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2022-07-05 15:22:12 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2024-01-29 10:30:37 +0100
commitbb71bc02fd9c6b0aac66fafaef0ca9737e501dfb (patch)
tree2423a7d2f8a10da64a51740deab05193b8caad16 /bgpd
parentbgpd: fix VRF leaking with 'network import-check' (1/4) (diff)
downloadfrr-bb71bc02fd9c6b0aac66fafaef0ca9737e501dfb.tar.xz
frr-bb71bc02fd9c6b0aac66fafaef0ca9737e501dfb.zip
bgpd: fix VRF leaking with 'network import-check' (2/4)
"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 <louis.scalbert@6wind.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_nht.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index 05fd0dc4e..dbf1fd2ea 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -918,24 +918,22 @@ void bgp_nexthop_update(struct vrf *vrf, struct prefix *match,
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