summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/rde_spf.c
diff options
context:
space:
mode:
authorEsben Norby <norby@cvs.openbsd.org>2006-02-01 20:24:09 +0000
committerEsben Norby <norby@cvs.openbsd.org>2006-02-01 20:24:09 +0000
commita28bf1b08705f1e791c73ffadce69c3da6e97dba (patch)
tree5bc8c196e00caa96c1d743348940f79c8587bb40 /usr.sbin/ospfd/rde_spf.c
parent65d5a87f3f8c247950ef24f1b2fd7f2c1237c47f (diff)
spf_calc should only do what the name says - calculate the spf tree.
ok claudio@
Diffstat (limited to 'usr.sbin/ospfd/rde_spf.c')
-rw-r--r--usr.sbin/ospfd/rde_spf.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/usr.sbin/ospfd/rde_spf.c b/usr.sbin/ospfd/rde_spf.c
index 22332430bd2..cca3910f2d8 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.44 2006/02/01 19:56:15 norby Exp $ */
+/* $OpenBSD: rde_spf.c,v 1.45 2006/02/01 20:24:08 norby Exp $ */
/*
* Copyright (c) 2005 Esben Norby <norby@openbsd.org>
@@ -77,7 +77,6 @@ spf_dump(struct area *area)
void
spf_calc(struct area *area)
{
- struct lsa_tree *tree = &area->lsa_tree;
struct vertex *v, *w;
struct lsa_rtr_link *rtr_link = NULL;
struct lsa_net_link *net_link;
@@ -194,16 +193,6 @@ spf_calc(struct area *area)
} while (v != NULL);
- /* calculate route table */
- RB_FOREACH(v, lsa_tree, tree) {
- rt_calc(v, area);
- }
-
- /* calculate as-external routes */
- RB_FOREACH(v, lsa_tree, &rdeconf->lsa_tree) {
- asext_calc(v);
- }
-
/* spf_dump(area); */
log_debug("spf_calc: calculation ended, area ID %s",
inet_ntoa(area->id));
@@ -537,6 +526,7 @@ cand_list_empty(void)
void
spf_timer(int fd, short event, void *arg)
{
+ struct vertex *v;
struct ospfd_conf *conf = arg;
struct area *area;
struct rt_node *r;
@@ -551,9 +541,21 @@ spf_timer(int fd, short event, void *arg)
case SPF_DELAY:
rt_invalidate();
- LIST_FOREACH(area, &conf->area_list, entry)
+ LIST_FOREACH(area, &conf->area_list, entry) {
+ /* calculate SPF tree */
spf_calc(area);
+ /* calculate route table */
+ RB_FOREACH(v, lsa_tree, &area->lsa_tree) {
+ rt_calc(v, area);
+ }
+ }
+
+ /* calculate as-external routes */
+ RB_FOREACH(v, lsa_tree, &rdeconf->lsa_tree) {
+ asext_calc(v);
+ }
+
RB_FOREACH(r, rt_tree, &rt) {
LIST_FOREACH(area, &conf->area_list, entry)
rde_summary_update(r, area);