summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/rde_spf.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2005-12-02 12:21:31 +0000
committerclaudio <claudio@openbsd.org>2005-12-02 12:21:31 +0000
commit5f83603022b0f456845681cf7d4f2f172438baf1 (patch)
tree04bf6af63f584af25428dfcc054d3fbf6b8908c7 /usr.sbin/ospfd/rde_spf.c
parent`-mmsg' does not belong here; (diff)
downloadwireguard-openbsd-5f83603022b0f456845681cf7d4f2f172438baf1.tar.xz
wireguard-openbsd-5f83603022b0f456845681cf7d4f2f172438baf1.zip
Fixed version of r1.35, readd candidate to list in both cases so that the list
remains sorted. Tested and OK norby@
Diffstat (limited to 'usr.sbin/ospfd/rde_spf.c')
-rw-r--r--usr.sbin/ospfd/rde_spf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/rde_spf.c b/usr.sbin/ospfd/rde_spf.c
index b442323b388..748c96df9f4 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.37 2005/11/14 11:48:05 norby Exp $ */
+/* $OpenBSD: rde_spf.c,v 1.38 2005/12/02 12:21:31 claudio Exp $ */
/*
* Copyright (c) 2005 Esben Norby <norby@openbsd.org>
@@ -172,14 +172,19 @@ spf_calc(struct area *area)
w->cost = d;
w->prev = v;
calc_next_hop(w, v);
+ /*
+ * need to readd to candidate list
+ * because the list is sorted
+ */
+ TAILQ_REMOVE(&cand_list, w, cand);
+ cand_list_add(w);
}
} else if (w->cost == LS_INFINITY && d < LS_INFINITY) {
w->cost = d;
-
- cand_list_add(w);
w->prev = v;
calc_next_hop(w, v);
+ cand_list_add(w);
}
}