From: Joakim Tjernlund Date: Sat, 7 Jul 2012 15:06:14 +0000 (+0200) Subject: ospfd: Do not fall back to intervening router. X-Git-Tag: frr-2.0-rc1~1786 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9289c6ff55cd96c943d23e43fc9e5f987aa965ed;p=mirror%2Ffrr.git ospfd: Do not fall back to intervening router. 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 Signed-off-by: David Lamparter --- diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 6682951195..abc8a91a80 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -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