diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2022-07-05 15:22:12 +0200 | 
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2022-12-16 14:52:47 +0100 | 
| commit | d0a55f87e9cd4d67e9514f31cfe589eeaec0ed4a (patch) | |
| tree | 1e324dabea6aafdbef06370c209b5a38053020fe /bgpd/bgp_nht.c | |
| parent | 1565c70984d286aceb2ed30de27a2d64359ca3c5 (diff) | |
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 <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd/bgp_nht.c')
| -rw-r--r-- | bgpd/bgp_nht.c | 22 | 
1 files changed, 10 insertions, 12 deletions
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  | 
