summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2012-10-03 08:40:41 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2012-10-03 08:40:41 +0000
commitacf2919b52008f0cdcb3a6815a9d1d1de41fc0ed (patch)
treee909d8cecfe59782d86e4bd75dc763af27a9ad11
parenta8234f985edd9f56dbf70928fb8c3bd3a14f85e7 (diff)
Inherit and pass the relay table flags correctly.
-rw-r--r--usr.sbin/relayd/config.c4
-rw-r--r--usr.sbin/relayd/parse.y3
-rw-r--r--usr.sbin/relayd/relay.c4
-rw-r--r--usr.sbin/relayd/relayd.h3
4 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/relayd/config.c b/usr.sbin/relayd/config.c
index 016f26cd911..6c26e9e24de 100644
--- a/usr.sbin/relayd/config.c
+++ b/usr.sbin/relayd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.4 2012/10/03 08:33:31 reyk Exp $ */
+/* $OpenBSD: config.c,v 1.5 2012/10/03 08:40:40 reyk Exp $ */
/*
* Copyright (c) 2011 Reyk Floeter <reyk@openbsd.org>
@@ -848,6 +848,7 @@ config_setrelay(struct relayd *env, struct relay *rlay)
crt.id = rlt->rlt_table->conf.id;
crt.relayid = rlay->rl_conf.id;
crt.mode = rlt->rlt_mode;
+ crt.flags = rlt->rlt_flags;
c = 0;
iov[c].iov_base = &crt;
@@ -970,6 +971,7 @@ config_getrelaytable(struct relayd *env, struct imsg *imsg)
rlt->rlt_table = table;
rlt->rlt_mode = crt.mode;
+ rlt->rlt_flags = crt.flags;
TAILQ_INSERT_TAIL(&rlay->rl_tables, rlt, rlt_entry);
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index 119e8193115..707403554ed 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.165 2012/10/03 08:33:31 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.166 2012/10/03 08:40:40 reyk Exp $ */
/*
* Copyright (c) 2007-2011 Reyk Floeter <reyk@openbsd.org>
@@ -2761,6 +2761,7 @@ relay_inherit(struct relay *ra, struct relay *rb)
}
rtb->rlt_table = rta->rlt_table;
rtb->rlt_mode = rta->rlt_mode;
+ rtb->rlt_flags = rta->rlt_flags;
TAILQ_INSERT_TAIL(&rb->rl_tables, rtb, rlt_entry);
}
diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c
index 47d279c3457..0289de67b80 100644
--- a/usr.sbin/relayd/relay.c
+++ b/usr.sbin/relayd/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.154 2012/10/03 08:33:31 reyk Exp $ */
+/* $OpenBSD: relay.c,v 1.155 2012/10/03 08:40:40 reyk Exp $ */
/*
* Copyright (c) 2006 - 2012 Reyk Floeter <reyk@openbsd.org>
@@ -1121,7 +1121,7 @@ relay_from_table(struct rsession *con)
/* otherwise grep the first active table */
TAILQ_FOREACH(rlt, &rlay->rl_tables, rlt_entry) {
table = rlt->rlt_table;
- if ((rlt->rlt_flags & F_USED == 0) ||
+ if ((rlt->rlt_flags & F_USED) == 0 ||
(table->conf.check && !table->up))
table = NULL;
else
diff --git a/usr.sbin/relayd/relayd.h b/usr.sbin/relayd/relayd.h
index 6b91f98814e..b02b62496a2 100644
--- a/usr.sbin/relayd/relayd.h
+++ b/usr.sbin/relayd/relayd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.h,v 1.159 2012/10/03 08:33:31 reyk Exp $ */
+/* $OpenBSD: relayd.h,v 1.160 2012/10/03 08:40:40 reyk Exp $ */
/*
* Copyright (c) 2006 - 2012 Reyk Floeter <reyk@openbsd.org>
@@ -112,6 +112,7 @@ struct ctl_relaytable {
objid_t id;
objid_t relayid;
int mode;
+ u_int32_t flags;
};
struct ctl_script {