mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-25 02:50:36 +00:00
bgpd: Testing for valid pointer is done by for loop
No need to test for valid pointer as that the for loop will do so as well. This reduces indentation. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
1d67a6e0bf
commit
b56758dae8
@ -2777,41 +2777,35 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
|
|||||||
}
|
}
|
||||||
|
|
||||||
new_select = pi1;
|
new_select = pi1;
|
||||||
if (pi1->next) {
|
for (pi2 = pi1->next; pi2; pi2 = pi2->next) {
|
||||||
for (pi2 = pi1->next; pi2; pi2 = pi2->next) {
|
if (CHECK_FLAG(pi2->flags, BGP_PATH_DMED_CHECK))
|
||||||
if (CHECK_FLAG(pi2->flags,
|
continue;
|
||||||
BGP_PATH_DMED_CHECK))
|
if (BGP_PATH_HOLDDOWN(pi2))
|
||||||
continue;
|
continue;
|
||||||
if (BGP_PATH_HOLDDOWN(pi2))
|
if (pi2->peer != bgp->peer_self &&
|
||||||
continue;
|
!CHECK_FLAG(pi2->peer->sflags,
|
||||||
if (pi2->peer != bgp->peer_self &&
|
PEER_STATUS_NSF_WAIT) &&
|
||||||
!CHECK_FLAG(pi2->peer->sflags,
|
!peer_established(pi2->peer->connection))
|
||||||
PEER_STATUS_NSF_WAIT) &&
|
continue;
|
||||||
!peer_established(
|
|
||||||
pi2->peer->connection))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!aspath_cmp_left(pi1->attr->aspath,
|
if (!aspath_cmp_left(pi1->attr->aspath,
|
||||||
pi2->attr->aspath)
|
pi2->attr->aspath) &&
|
||||||
&& !aspath_cmp_left_confed(
|
!aspath_cmp_left_confed(pi1->attr->aspath,
|
||||||
pi1->attr->aspath,
|
pi2->attr->aspath))
|
||||||
pi2->attr->aspath))
|
continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
if (bgp_path_info_cmp(
|
if (bgp_path_info_cmp(bgp, pi2, new_select,
|
||||||
bgp, pi2, new_select,
|
&paths_eq, mpath_cfg,
|
||||||
&paths_eq, mpath_cfg, debug,
|
debug, pfx_buf, afi, safi,
|
||||||
pfx_buf, afi, safi,
|
&dest->reason)) {
|
||||||
&dest->reason)) {
|
bgp_path_info_unset_flag(dest,
|
||||||
bgp_path_info_unset_flag(
|
new_select,
|
||||||
dest, new_select,
|
BGP_PATH_DMED_SELECTED);
|
||||||
BGP_PATH_DMED_SELECTED);
|
new_select = pi2;
|
||||||
new_select = pi2;
|
|
||||||
}
|
|
||||||
|
|
||||||
bgp_path_info_set_flag(
|
|
||||||
dest, pi2, BGP_PATH_DMED_CHECK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bgp_path_info_set_flag(dest, pi2,
|
||||||
|
BGP_PATH_DMED_CHECK);
|
||||||
}
|
}
|
||||||
bgp_path_info_set_flag(dest, new_select,
|
bgp_path_info_set_flag(dest, new_select,
|
||||||
BGP_PATH_DMED_CHECK);
|
BGP_PATH_DMED_CHECK);
|
||||||
|
Loading…
Reference in New Issue
Block a user