summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relay.c
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2010-08-01 22:18:36 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2010-08-01 22:18:36 +0000
commitcdd6e40c207147df7d38343d2a8f64aa10e8fe67 (patch)
treec4543e50c53d050f9a0685be36614223e43f00d8 /usr.sbin/relayd/relay.c
parent463b4ea5bf80f22b0d7fcc5ef79e3a0ceccd642e (diff)
Allow fallback tables for relays, not just redirections.
Seems reasonable to jsg, ok phessler, no response from reyk or pyr
Diffstat (limited to 'usr.sbin/relayd/relay.c')
-rw-r--r--usr.sbin/relayd/relay.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c
index a0562187c16..dcd1e5863f1 100644
--- a/usr.sbin/relayd/relay.c
+++ b/usr.sbin/relayd/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.121 2010/05/26 13:56:08 nicm Exp $ */
+/* $OpenBSD: relay.c,v 1.122 2010/08/01 22:18:35 sthen Exp $ */
/*
* Copyright (c) 2006, 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -2123,9 +2123,11 @@ relay_from_table(struct rsession *con)
u_int32_t p = con->se_hashkey;
int idx = 0;
- if (table->conf.check && !table->up) {
+ if (table->conf.check && !table->up && !rlay->rl_backuptable->up) {
log_debug("relay_from_table: no active hosts");
return (-1);
+ } else if (!table->up && rlay->rl_backuptable->up) {
+ table = rlay->rl_backuptable;
}
switch (rlay->rl_conf.dstmode) {