diff options
author | Paul Jakma <paul@quagga.net> | 2009-08-03 15:16:41 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2009-08-03 16:52:38 +0100 |
commit | 4ca15d4a658dca9663b7dea2475edfe6814ef847 (patch) | |
tree | a756f68b118cf641f8f91966e771345d4a177b76 | |
parent | a8ba847ff96b41e06770d4987b15707890ed5807 (diff) |
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.
-rw-r--r-- | ospfd/ospf_lsa.c | 5 | ||||
-rw-r--r-- | ospfd/ospf_spf.c | 19 |
2 files changed, 17 insertions, 7 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 15a6a4c4..acc9c3f4 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -1528,7 +1528,10 @@ ospf_external_lsa_nexthop_get (struct ospf *ospf, struct in_addr nexthop) nh.family = AF_INET; nh.u.prefix4 = nexthop; nh.prefixlen = IPV4_MAX_BITLEN; - + + /* XXX/SCALE: If there were a lot of oi's on an ifp, then it'd be + * better to make use of the per-ifp table of ois. + */ for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) if (if_is_operative (oi->ifp)) if (oi->address->family == AF_INET) diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 95668435..ca200222 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); |