summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_spf.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 18:03:53 -0700
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 18:03:53 -0700
commit0f23bb679b966782fe72060d112b60ce1bd0af7a (patch)
tree834b919ad71c45d913fdec581b084c47f8851434 /ospf6d/ospf6_spf.c
parentd973c4f045872450aa5c9b087d71f407dfe53591 (diff)
Fixing a couple of issues with ospf6_route_remove () routine.
When a route_node has multiple ospf6_routes under it (common subnet case), then the current implementation has an issue in adjusting the route_node->info on a ospf6_route_remove() call. The main reason is that it ends up using exact match to determine if the next ospf6_route belongs to the same route_node or not. Fixing that part to use rnode (the existing back-pointer to the route_node) from the ospf6_route to determine that. Also fixing some of the walks to turn them safe so that the route deletion is fine. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Diffstat (limited to 'ospf6d/ospf6_spf.c')
-rw-r--r--ospf6d/ospf6_spf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 04d02d7085..3713c51517 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -410,11 +410,12 @@ ospf6_spf_install (struct ospf6_vertex *v,
void
ospf6_spf_table_finish (struct ospf6_route_table *result_table)
{
- struct ospf6_route *route;
+ struct ospf6_route *route, *nroute;
struct ospf6_vertex *v;
for (route = ospf6_route_head (result_table); route;
- route = ospf6_route_next (route))
+ route = nroute)
{
+ nroute = ospf6_route_next (route);
v = (struct ospf6_vertex *) route->route_option;
ospf6_vertex_delete (v);
ospf6_route_remove (route, result_table);