diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-03-04 18:50:57 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-03-04 18:50:57 +0100 |
commit | 850dda33ce2a5d3c1ea89f0e45dfe7ad716f4fe0 (patch) | |
tree | 4fc59c96bb8d05643d9e594d06e846066c41f225 | |
parent | Merge pull request #5894 from patrasar/2399927 (diff) | |
download | frr-850dda33ce2a5d3c1ea89f0e45dfe7ad716f4fe0.tar.xz frr-850dda33ce2a5d3c1ea89f0e45dfe7ad716f4fe0.zip |
ospfd: Fix 4 levels of unnecessary indentation
Optimize display of code a tiny bit so that we can actually
have readable code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | ospfd/ospf_ism.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/ospfd/ospf_ism.c b/ospfd/ospf_ism.c index f4e89da45..86712c619 100644 --- a/ospfd/ospf_ism.c +++ b/ospfd/ospf_ism.c @@ -183,17 +183,22 @@ static void ospf_dr_change(struct ospf *ospf, struct route_table *nbrs) struct route_node *rn; struct ospf_neighbor *nbr; - for (rn = route_top(nbrs); rn; rn = route_next(rn)) - if ((nbr = rn->info) != NULL) - /* Ignore 0.0.0.0 node*/ - if (nbr->router_id.s_addr != INADDR_ANY) - /* Is neighbor upper 2-Way? */ - if (nbr->state >= NSM_TwoWay) - /* Ignore myself. */ - if (!IPV4_ADDR_SAME(&nbr->router_id, - &ospf->router_id)) - OSPF_NSM_EVENT_SCHEDULE( - nbr, NSM_AdjOK); + for (rn = route_top(nbrs); rn; rn = route_next(rn)) { + nbr = rn->info; + + if (!nbr) + continue; + + /* + * Ignore 0.0.0.0 node + * Is neighbor 2-Way? + * Ignore myself + */ + if (nbr->router_id.s_addr != INADDR_ANY + && nbr->state >= NSM_TwoWay + && !IPV4_ADDR_SAME(&nbr->router_id, &ospf->router_id)) + OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_AdjOK); + } } static int ospf_dr_election(struct ospf_interface *oi) |