]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: update some comments
authorPaul Jakma <paul@quagga.net>
Mon, 3 Aug 2009 14:16:41 +0000 (15:16 +0100)
committerPaul Jakma <paul@quagga.net>
Mon, 3 Aug 2009 15:52:38 +0000 (16:52 +0100)
* ospf_{spf,lsa}.c: remove out of date comment; add comment on some
  non-obvious code; Make note of a possible scaling problem.

ospfd/ospf_lsa.c
ospfd/ospf_spf.c

index 15a6a4c4b6097bf58bae1753fe01c8fad4e9eb9c..acc9c3f497e6906f351550c969a88635a51716c6 100644 (file)
@@ -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)
index 956684357059385afb76c0eb2933ed7df7fbc843..ca20022248b2e9665c15a5fad66a85af140edb5b 100644 (file)
@@ -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);