summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpyr <pyr@openbsd.org>2007-09-27 07:32:50 +0000
committerpyr <pyr@openbsd.org>2007-09-27 07:32:50 +0000
commit228f7fe4bb82cdb5da416900d7df055a87dcc251 (patch)
treed7fd479bbb69a902749c4777481341533e36b114
parentZap HostAP examples for now. (diff)
downloadwireguard-openbsd-228f7fe4bb82cdb5da416900d7df055a87dcc251.tar.xz
wireguard-openbsd-228f7fe4bb82cdb5da416900d7df055a87dcc251.zip
Do not clear the changed flag to early, which prevented a table
from being used by several services. ``looks fine'' reyk@
-rw-r--r--usr.sbin/hoststated/pfe.c13
-rw-r--r--usr.sbin/relayd/pfe.c13
2 files changed, 18 insertions, 8 deletions
diff --git a/usr.sbin/hoststated/pfe.c b/usr.sbin/hoststated/pfe.c
index 4b5c29090ae..3419cbe20ce 100644
--- a/usr.sbin/hoststated/pfe.c
+++ b/usr.sbin/hoststated/pfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfe.c,v 1.34 2007/09/07 08:20:24 reyk Exp $ */
+/* $OpenBSD: pfe.c,v 1.35 2007/09/27 07:32:50 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -846,9 +846,6 @@ pfe_sync(void)
control_imsg_forward(&imsg);
}
- service->table->conf.flags &= ~(F_CHANGED);
- service->backup->conf.flags &= ~(F_CHANGED);
-
if (service->conf.flags & F_DOWN) {
if (service->conf.flags & F_ACTIVE_RULESET) {
flush_table(env, service);
@@ -874,6 +871,14 @@ pfe_sync(void)
}
TAILQ_FOREACH(table, env->tables, entry) {
+ /*
+ * clean up change flag.
+ */
+ table->conf.flags &= ~(F_CHANGED);
+
+ /*
+ * handle demotion.
+ */
if ((table->conf.flags & F_DEMOTE) == 0)
continue;
demote.level = 0;
diff --git a/usr.sbin/relayd/pfe.c b/usr.sbin/relayd/pfe.c
index 4b5c29090ae..3419cbe20ce 100644
--- a/usr.sbin/relayd/pfe.c
+++ b/usr.sbin/relayd/pfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfe.c,v 1.34 2007/09/07 08:20:24 reyk Exp $ */
+/* $OpenBSD: pfe.c,v 1.35 2007/09/27 07:32:50 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -846,9 +846,6 @@ pfe_sync(void)
control_imsg_forward(&imsg);
}
- service->table->conf.flags &= ~(F_CHANGED);
- service->backup->conf.flags &= ~(F_CHANGED);
-
if (service->conf.flags & F_DOWN) {
if (service->conf.flags & F_ACTIVE_RULESET) {
flush_table(env, service);
@@ -874,6 +871,14 @@ pfe_sync(void)
}
TAILQ_FOREACH(table, env->tables, entry) {
+ /*
+ * clean up change flag.
+ */
+ table->conf.flags &= ~(F_CHANGED);
+
+ /*
+ * handle demotion.
+ */
if ((table->conf.flags & F_DEMOTE) == 0)
continue;
demote.level = 0;