summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_spf.c
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2009-08-03 16:16:41 +0200
committerPaul Jakma <paul@quagga.net>2009-08-03 17:52:38 +0200
commit4ca15d4a658dca9663b7dea2475edfe6814ef847 (patch)
treea756f68b118cf641f8f91966e771345d4a177b76 /ospfd/ospf_spf.c
parentospfd: Change struct ospf_path *oi to ifindex. (diff)
downloadfrr-4ca15d4a658dca9663b7dea2475edfe6814ef847.tar.xz
frr-4ca15d4a658dca9663b7dea2475edfe6814ef847.zip
ospfd: update some comments
* ospf_{spf,lsa}.c: remove out of date comment; add comment on some non-obvious code; Make note of a possible scaling problem.
Diffstat (limited to 'ospfd/ospf_spf.c')
-rw-r--r--ospfd/ospf_spf.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 956684357..ca2002224 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -678,6 +678,19 @@ ospf_nexthop_calculation (struct ospf_area *area, struct vertex *v,
}
}
}
+ /* NB: This code is non-trivial.
+ *
+ * E.g. it is not enough to know that V connects to the root. It is
+ * also important that the while above, looping through all links from
+ * W->V found at least one link, so that we know there is
+ * bi-directional connectivity between V and W. Otherwise, if we
+ * /always/ return here, but don't check that W->V exists then we
+ * we will prevent SPF from finding/using higher cost paths..
+ *
+ * See also bug #330, and also:
+ *
+ * http://blogs.sun.com/paulj/entry/the_difference_a_line_makes
+ */
if (added)
return added;
}
@@ -1164,12 +1177,6 @@ ospf_spf_calculate (struct ospf_area *area, struct route_table *new_table,
ospf_vertex_add_parent (v);
- /* Note that when there is a choice of vertices closest to the
- root, network vertices must be chosen before router vertices
- in order to necessarily find all equal-cost paths. */
- /* We don't do this at this moment, we should add the treatment
- above codes. -- kunihiro. */
-
/* RFC2328 16.1. (4). */
if (v->type == OSPF_VERTEX_ROUTER)
ospf_intra_add_router (new_rtrs, v, area);