]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Do not fall back to intervening router.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Sat, 7 Jul 2012 15:06:14 +0000 (17:06 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 25 Jul 2012 16:07:45 +0000 (18:07 +0200)
The patch in bug 330 did two things. It add a return value
whether ospf_nexthop_calculation() failed or not and also
moved the return stmt for 16.1.1 para 5 so now SPF
will fallback to the intervening router when no back links are found
by 16.1.1 para 5. This is wrong and can potentially create black holes
or routing loops according to Dave Katz and Acee Lindem at ospf@ietf.org

Even if the current code could be proved to be harmless in all cases,
it adds substantial extra processing and memory allocations.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ospfd/ospf_spf.c

index 6682951195907c8631cc985e94832c2037522d6f..abc8a91a800187ec044500c57f29c5ae3cf979a5 100644 (file)
@@ -675,23 +675,11 @@ ospf_nexthop_calculation (struct ospf_area *area, struct vertex *v,
                  added = 1;
                   ospf_spf_add_parent (v, w, nh, distance);
                 }
+             /* Always return here as we known that 16.1.1 para 4
+                does not apply one you have found a connection to root */
+             return added;
             }
         }
-      /* 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;
     }
 
   /* 16.1.1 para 4.  If there is at least one intervening router in the