summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/rde_spf.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2005-08-08 12:22:48 +0000
committerclaudio <claudio@openbsd.org>2005-08-08 12:22:48 +0000
commit582957f9a3f3847f2bba6dbb03331c54a1cbbe0a (patch)
tree1cffe34a7079dfe041d193775360de3876fa328b /usr.sbin/ospfd/rde_spf.c
parentInitial import of watchdogd, a daemon to retrigger the watchdog timer (diff)
downloadwireguard-openbsd-582957f9a3f3847f2bba6dbb03331c54a1cbbe0a.tar.xz
wireguard-openbsd-582957f9a3f3847f2bba6dbb03331c54a1cbbe0a.zip
Try to do an SPF recalculation only if the LS DB changed.
This is still not perfect as on ABRs it is only necessary to recalculate the area that got changed and not all others too. More to come but it is a good start. OK norby@
Diffstat (limited to 'usr.sbin/ospfd/rde_spf.c')
-rw-r--r--usr.sbin/ospfd/rde_spf.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/ospfd/rde_spf.c b/usr.sbin/ospfd/rde_spf.c
index fa783880f87..745350caaa2 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.30 2005/08/08 08:51:47 claudio Exp $ */
+/* $OpenBSD: rde_spf.c,v 1.31 2005/08/08 12:22:48 claudio Exp $ */
/*
* Copyright (c) 2005 Esben Norby <norby@openbsd.org>
@@ -353,7 +353,7 @@ spf_calc(struct area *area)
inet_ntoa(area->id));
area->num_spf_calc++;
- start_spf_timer(rdeconf);
+ start_spf_timer();
return;
}
@@ -558,7 +558,7 @@ spf_timer(int fd, short event, void *arg)
LIST_FOREACH(area, &conf->area_list, entry)
lsa_remove_invalid_sums(area);
- start_spf_holdtimer(rdeconf);
+ start_spf_holdtimer(conf);
break;
case SPF_HOLD:
log_debug("spf_timer: state HOLD -> IDLE");
@@ -570,23 +570,23 @@ spf_timer(int fd, short event, void *arg)
}
int
-start_spf_timer(struct ospfd_conf *conf)
+start_spf_timer(void)
{
struct timeval tv;
- switch (conf->spf_state) {
+ switch (rdeconf->spf_state) {
case SPF_IDLE:
log_debug("start_spf_timer: IDLE -> DELAY");
timerclear(&tv);
- tv.tv_sec = conf->spf_delay;
- conf->spf_state = SPF_DELAY;
- return (evtimer_add(&conf->spf_timer, &tv));
+ tv.tv_sec = rdeconf->spf_delay;
+ rdeconf->spf_state = SPF_DELAY;
+ return (evtimer_add(&rdeconf->spf_timer, &tv));
case SPF_DELAY:
/* ignore */
break;
case SPF_HOLD:
log_debug("start_spf_timer: HOLD -> HOLDQUEUE");
- conf->spf_state = SPF_HOLDQUEUE;
+ rdeconf->spf_state = SPF_HOLDQUEUE;
break;
case SPF_HOLDQUEUE:
/* ignore */