summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2012-07-07 17:06:14 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2012-07-25 18:07:45 +0200
commit9289c6ff55cd96c943d23e43fc9e5f987aa965ed (patch)
treeb971fa4b0ce15e02abd27a62548d53371e4cc0b2 /ospfd
parentba281d3d04053b7c59ecdfdbea91a62c09e9f8a4 (diff)
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 <Joakim.Tjernlund@transmode.se> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_spf.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 66829511..abc8a91a 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