From edc632be5c951befc6026c02e7e673a1e381cb20 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 4 Mar 2024 09:51:42 -0500 Subject: [PATCH] bgpd: Cleanup indenting for subgroup_default_originate Part of the subgroup_default_originate function was indented very deeply. Clean this up some. Signed-off-by: Donald Sharp --- bgpd/bgp_updgrp_adv.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 1e996012ef56..eb176131ee5e 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -993,22 +993,23 @@ void subgroup_default_originate(struct update_subgroup *subgrp, bool withdraw) if (dest) { for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) { - if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)) { - if (subgroup_announce_check( - dest, pi, subgrp, - bgp_dest_get_prefix(dest), - &attr, NULL)) { - struct attr *default_attr = - bgp_attr_intern(&attr); - - if (!bgp_adj_out_set_subgroup( - dest, subgrp, - default_attr, pi)) - bgp_attr_unintern( - &default_attr); - } else - bgp_attr_flush(&attr); - } + if (!CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)) + continue; + + if (subgroup_announce_check(dest, pi, subgrp, + bgp_dest_get_prefix( + dest), + &attr, NULL)) { + struct attr *default_attr = + bgp_attr_intern(&attr); + + if (!bgp_adj_out_set_subgroup(dest, + subgrp, + default_attr, + pi)) + bgp_attr_unintern(&default_attr); + } else + bgp_attr_flush(&attr); } bgp_dest_unlock_node(dest); }