summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_spf.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-27 14:25:29 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-27 14:25:29 -0700
commitea01b56bc3f43b268d32d175095a2a930d3b2967 (patch)
treee3e11bc827541bc983105a731636a78bc30bb5fa /ospfd/ospf_spf.c
parent0eb78a78cffc4a5c13e2b5daff5fa257b3f1d8d6 (diff)
parentd3e384e4f00aa90db4310f82f3cbe6528e256334 (diff)
downloadquagga-ea01b56bc3f43b268d32d175095a2a930d3b2967.tar.bz2
quagga-ea01b56bc3f43b268d32d175095a2a930d3b2967.tar.xz
Merge in latest quagga (0.99.11)
Merge in current upstream version of quagga.
Diffstat (limited to 'ospfd/ospf_spf.c')
-rw-r--r--ospfd/ospf_spf.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 34d25ed5..82f0fedd 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -946,7 +946,8 @@ ospf_spf_dump (struct vertex *v, int i)
/* Second stage of SPF calculation. */
static void
ospf_spf_process_stubs (struct ospf_area *area, struct vertex *v,
- struct route_table *rt)
+ struct route_table *rt,
+ int parent_is_root)
{
struct listnode *cnode, *cnnode;
struct vertex *child;
@@ -981,7 +982,7 @@ ospf_spf_process_stubs (struct ospf_area *area, struct vertex *v,
(l->m[0].tos_count * ROUTER_LSA_TOS_SIZE));
if (l->m[0].type == LSA_LINK_TYPE_STUB)
- ospf_intra_add_stub (rt, l, v, area);
+ ospf_intra_add_stub (rt, l, v, area, parent_is_root);
}
}
@@ -991,8 +992,17 @@ ospf_spf_process_stubs (struct ospf_area *area, struct vertex *v,
{
if (CHECK_FLAG (child->flags, OSPF_VERTEX_PROCESSED))
continue;
-
- ospf_spf_process_stubs (area, child, rt);
+
+ /* the first level of routers connected to the root
+ * should have 'parent_is_root' set, including those
+ * connected via a network vertex.
+ */
+ if (area->spf == v)
+ parent_is_root = 1;
+ else if (v->type == OSPF_VERTEX_ROUTER)
+ parent_is_root = 0;
+
+ ospf_spf_process_stubs (area, child, rt, parent_is_root);
SET_FLAG (child->flags, OSPF_VERTEX_PROCESSED);
}
@@ -1024,7 +1034,6 @@ ospf_rtrs_free (struct route_table *rtrs)
route_table_finish (rtrs);
}
-#if 0
static void
ospf_rtrs_print (struct route_table *rtrs)
{
@@ -1083,7 +1092,6 @@ ospf_rtrs_print (struct route_table *rtrs)
zlog_debug ("ospf_rtrs_print() end");
}
-#endif
/* Calculating the shortest-path tree for an area. */
static void
@@ -1181,7 +1189,7 @@ ospf_spf_calculate (struct ospf_area *area, struct route_table *new_table,
}
/* Second stage of SPF calculation procedure's */
- ospf_spf_process_stubs (area, area->spf, new_table);
+ ospf_spf_process_stubs (area, area->spf, new_table, 0);
/* Free candidate queue. */
pqueue_delete (candidate);