summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-08-05 19:01:57 +0000
committerpjd <pjd@FreeBSD.org>2010-08-05 19:01:57 +0000
commit64f20fee8760b7e158ffef062ffa7abc5eeb0943 (patch)
tree9ee9b25b6b21e4eae10880da4dd41333e1d107ef
parent25464151ef8b7f02e9228c7f27af79d7776e6c16 (diff)
downloadFreeBSD-src-64f20fee8760b7e158ffef062ffa7abc5eeb0943.zip
FreeBSD-src-64f20fee8760b7e158ffef062ffa7abc5eeb0943.tar.gz
Allow to use 'none' keywork as remote address in case second cluster node
is not setup yet. MFC after: 1 month
-rw-r--r--sbin/hastd/primary.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c
index 58e6cea..faaa136 100644
--- a/sbin/hastd/primary.c
+++ b/sbin/hastd/primary.c
@@ -298,6 +298,13 @@ hast_activemap_flush(struct hast_resource *res)
return (0);
}
+static bool
+real_remote(const struct hast_resource *res)
+{
+
+ return (strcmp(res->hr_remoteaddr, "none") != 0);
+}
+
static void
init_environment(struct hast_resource *res __unused)
{
@@ -479,6 +486,7 @@ init_remote(struct hast_resource *res, struct proto_conn **inp,
size_t size;
assert((inp == NULL && outp == NULL) || (inp != NULL && outp != NULL));
+ assert(real_remote(res));
in = out = NULL;
@@ -765,7 +773,7 @@ hastd_primary(struct hast_resource *res)
signal(SIGCHLD, SIG_DFL);
init_local(res);
- if (init_remote(res, NULL, NULL))
+ if (real_remote(res) && init_remote(res, NULL, NULL))
sync_start();
init_ggate(res);
init_environment(res);
@@ -1760,7 +1768,7 @@ guard_thread(void *arg)
pjdlog_debug(2,
"remote_guard: Connection to %s is ok.",
res->hr_remoteaddr);
- } else {
+ } else if (real_remote(res)) {
assert(res->hr_remotein == NULL);
assert(res->hr_remoteout == NULL);
/*
@@ -1795,6 +1803,8 @@ guard_thread(void *arg)
res->hr_remoteaddr);
timeout = RECONNECT_SLEEP;
}
+ } else {
+ rw_unlock(&hio_remote_lock[ii]);
}
}
(void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout);
OpenPOWER on IntegriCloud