diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-05-27 00:56:36 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-05-27 00:56:36 +0000 |
commit | adddf06606308e5ae06022568f39b6d98e0fcd62 (patch) | |
tree | c3dd6f719b3cae5c301cf8b1da1b12d2650b2d97 /usr.sbin/ospfd/rde_spf.c | |
parent | e8e98340a84c79a03d25846a5cfede828f178261 (diff) |
Only checking if w->cost is non equal to LS_INFINITY and w->prev is NULL is
not enough to distinguish between calculated vertexes and those just queued
in the candidate list. So add a additional check if the vertex is on the
candidate list. This fixes a problem Stephen Marley reported some time ago.
OK norby@
Diffstat (limited to 'usr.sbin/ospfd/rde_spf.c')
-rw-r--r-- | usr.sbin/ospfd/rde_spf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/rde_spf.c b/usr.sbin/ospfd/rde_spf.c index 0fd657920c2..1811f4e48ba 100644 --- a/usr.sbin/ospfd/rde_spf.c +++ b/usr.sbin/ospfd/rde_spf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_spf.c,v 1.22 2005/05/27 00:50:50 claudio Exp $ */ +/* $OpenBSD: rde_spf.c,v 1.23 2005/05/27 00:56:35 claudio Exp $ */ /* * Copyright (c) 2005 Esben Norby <norby@openbsd.org> @@ -155,9 +155,10 @@ spf_calc(struct area *area) log_debug("spf_calc: w has no link to v"); continue; } - if (w->cost != LS_INFINITY && w->prev != NULL) { + if (w->cost != LS_INFINITY && w->prev != NULL && + !cand_list_present(w)) continue; - } + if (v->type == LSA_TYPE_ROUTER) d = v->cost + ntohs(rtr_link->metric); else |