summaryrefslogtreecommitdiff
path: root/ospfd/ospf_ase.c
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2010-04-13 22:43:34 +0100
committerPaul Jakma <paul@quagga.net>2010-12-08 17:11:18 +0000
commite8f2226195e86f90f2409549ad8a8e5c8d64d23b (patch)
treee06409c762058421671fa7eacedeeccd364d871d /ospfd/ospf_ase.c
parent6634974d68b8cc78cdde1104636fe97d7e310845 (diff)
ospfd: Fix various route_unlock discrepencies
* ospf_ase.c: (ospf_ase_calculate_route) Fix compiler warning about eval needing brackets. (various) add defensive asserts. * ospf_lsdb.c: (ospf_lsdb_add) add missing node unlock if same lsa already was indexed. (ospf_lsdb_delete) check it's actually the same as specified lsa before deleting (ospf_lsdb_lookup_by_id_next) fix another corner case - no result => don't go on.
Diffstat (limited to 'ospfd/ospf_ase.c')
-rw-r--r--ospfd/ospf_ase.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index 5d0cae42..3c199311 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -451,8 +451,8 @@ 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))
+ if ((rn = route_node_lookup (ospf->new_table,
+ (struct prefix *) &p)))
{
route_unlock_node(rn);
if (rn->info == NULL)
@@ -463,8 +463,8 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa)
}
/* 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))
+ if ((rn = route_node_lookup (ospf->new_external_route,
+ (struct prefix *) &p)))
route_unlock_node(rn);
if (!rn || (or = rn->info) == NULL)
@@ -718,7 +718,6 @@ ospf_ase_register_external_lsa (struct ospf_lsa *lsa, struct ospf *top)
/* We assume that if LSA is deleted from DB
is is also deleted from this RT */
-
listnode_add (lst, ospf_lsa_lock (lsa)); /* external_lsas lst */
}
@@ -799,7 +798,8 @@ ospf_ase_incremental_update (struct ospf *ospf, struct ospf_lsa *lsa)
}
rn = route_node_lookup (ospf->external_lsas, (struct prefix *) &p);
- assert (rn && rn->info);
+ assert (rn);
+ assert (rn->info);
lsas = rn->info;
route_unlock_node (rn);