diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c index 2c5aa0f6f390..7c7c93b2e5ee 100644 --- a/sbin/hastd/primary.c +++ b/sbin/hastd/primary.c @@ -701,6 +701,11 @@ init_remote(struct hast_resource *res, struct proto_conn **inp, (void)hast_activemap_flush(res); } nv_free(nvin); + /* Setup directions. */ + if (proto_send(out, NULL, 0) == -1) + pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); + if (proto_recv(in, NULL, 0) == -1) + pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); pjdlog_info("Connected to %s.", res->hr_remoteaddr); if (inp != NULL && outp != NULL) { *inp = in; diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c index f2e58bd3e529..d47f8fa28c52 100644 --- a/sbin/hastd/secondary.c +++ b/sbin/hastd/secondary.c @@ -183,6 +183,10 @@ init_remote(struct hast_resource *res, struct nv *nvin) unsigned char *map; size_t mapsize; + /* Setup direction. */ + if (proto_send(res->hr_remoteout, NULL, 0) == -1) + pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); + map = NULL; mapsize = 0; nvout = nv_alloc(); @@ -346,6 +350,9 @@ init_remote(struct hast_resource *res, struct nv *nvin) if (map != NULL) free(map); nv_free(nvout); + /* Setup direction. */ + if (proto_recv(res->hr_remotein, NULL, 0) == -1) + pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); if (res->hr_secondary_localcnt > res->hr_primary_remotecnt && res->hr_primary_localcnt > res->hr_secondary_remotecnt) { /* Exit on split-brain. */