summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/hast_proto.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2013-02-17 21:12:34 +0000
committerpjd <pjd@FreeBSD.org>2013-02-17 21:12:34 +0000
commit0bf19fd81213327b0ddfd5708b76528fbdb507af (patch)
tree583fbe402107b2dad647b0a09363284f8a367ac2 /sbin/hastd/hast_proto.c
parente5238fcb15d4fbacf835cb112ac49dcb28ff894d (diff)
downloadFreeBSD-src-0bf19fd81213327b0ddfd5708b76528fbdb507af.zip
FreeBSD-src-0bf19fd81213327b0ddfd5708b76528fbdb507af.tar.gz
- Add support for 'memsync' mode. This is the fastest replication mode that's
why it will now be the default. - Bump protocol version to 2 and add backward compatibility for version 1. - Allow to specify hosts by kern.hostid as well (in addition to hostname and kern.hostuuid) in configuration file. Sponsored by: Panzura Tested by: trociny
Diffstat (limited to 'sbin/hastd/hast_proto.c')
-rw-r--r--sbin/hastd/hast_proto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/hastd/hast_proto.c b/sbin/hastd/hast_proto.c
index 039e767..dd41fb1 100644
--- a/sbin/hastd/hast_proto.c
+++ b/sbin/hastd/hast_proto.c
@@ -112,7 +112,7 @@ hast_proto_send(const struct hast_resource *res, struct proto_conn *conn,
if (eb == NULL)
goto end;
- hdr.version = HAST_PROTO_VERSION;
+ hdr.version = res != NULL ? res->hr_version : HAST_PROTO_VERSION;
hdr.size = htole32((uint32_t)ebuf_size(eb));
if (ebuf_add_head(eb, &hdr, sizeof(hdr)) == -1)
goto end;
@@ -144,7 +144,7 @@ hast_proto_recv_hdr(const struct proto_conn *conn, struct nv **nvp)
if (proto_recv(conn, &hdr, sizeof(hdr)) == -1)
goto fail;
- if (hdr.version != HAST_PROTO_VERSION) {
+ if (hdr.version > HAST_PROTO_VERSION) {
errno = ERPCMISMATCH;
goto fail;
}
OpenPOWER on IntegriCloud