diff options
author | Joakim Tjernlund <Joakim.Tjernlund@transmode.se> | 2009-02-04 15:05:19 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2009-06-25 15:00:40 +0200 |
commit | 3d8617b853af511ca5f019b2f51c7902e2689212 (patch) | |
tree | bb366c8a716653d315f64457a9ea642a370170d3 | |
parent | [ospfd] Fix a few LSA performance "bugs" (diff) | |
download | frr-3d8617b853af511ca5f019b2f51c7902e2689212.tar.xz frr-3d8617b853af511ca5f019b2f51c7902e2689212.zip |
[ospfd] external LSA route_unlock_node() fixes
A few route_unlock_node() calls was missing.
-rw-r--r-- | ospfd/ospf_ase.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c index a4812345c..3eb29f8ac 100644 --- a/ospfd/ospf_ase.c +++ b/ospfd/ospf_ase.c @@ -448,20 +448,23 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa) /* if there is a Intra/Inter area route to the N do not install external route */ - if ((rn = route_node_lookup (ospf->new_table, - (struct prefix *) &p)) != NULL - && (rn->info != NULL)) + if (rn = route_node_lookup (ospf->new_table, + (struct prefix *) &p)) { + route_unlock_node(rn); + if (rn->info == NULL) + zlog_info ("Route[External]: rn->info NULL"); if (new) ospf_route_free (new); return 0; } - /* Find a route to the same dest */ /* If there is no route, create new one. */ - if ((rn = route_node_lookup (ospf->new_external_route, - (struct prefix *) &p)) == NULL - || (or = rn->info) == NULL) + if (rn = route_node_lookup (ospf->new_external_route, + (struct prefix *) &p)) + route_unlock_node(rn); + + if (!rn || (or = rn->info) == NULL) { if (IS_DEBUG_OSPF (lsa, LSA)) zlog_debug ("Route[External]: Adding a new route %s/%d", @@ -783,16 +786,18 @@ ospf_ase_incremental_update (struct ospf *ospf, struct ospf_lsa *lsa) (internal routes take precedence). */ rn = route_node_lookup (ospf->new_table, (struct prefix *) &p); - if (rn && rn->info) + if (rn) { route_unlock_node (rn); - return; + if (rn->info) + return; } rn = route_node_lookup (ospf->external_lsas, (struct prefix *) &p); assert (rn && rn->info); lsas = rn->info; - + route_unlock_node (rn); + for (ALL_LIST_ELEMENTS_RO (lsas, node, lsa)) ospf_ase_calculate_route (ospf, lsa); |