Skip to content

Commit

Permalink
bgpd: Cleanup indenting for subgroup_default_originate
Browse files Browse the repository at this point in the history
Part of the subgroup_default_originate function was indented
very deeply.  Clean this up some.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Mar 7, 2024
1 parent 69f7509 commit edc632b
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions bgpd/bgp_updgrp_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit edc632b

Please sign in to comment.