From b6c417785e54620331ae35d6971fe8bef98b4619 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Tue, 22 Jan 2019 12:10:59 +0530 Subject: rpc: use address-family option from vol file This patch helps enable IPv6 connections in the cluster. The default address-family is IPv4 without using this option explicitly. When address-family is set to "inet6" in the /etc/glusterfs/glusterd.vol file, the mount command-line also needs to have -o xlator-option="transport.address-family=inet6" added to it. This option also gets added to the brick command-line. Snapshot and gfapi use-cases should also use this option to pass in the inet6 address-family. Change-Id: I97db91021af27bacb6d7578e33ea4817f66d7270 fixes: bz#1635863 Signed-off-by: Milind Changire --- rpc/rpc-lib/src/rpc-transport.c | 4 ++-- rpc/rpc-lib/src/rpc-transport.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'rpc') diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c index 0c9291380be..e6421fcfab5 100644 --- a/rpc/rpc-lib/src/rpc-transport.c +++ b/rpc/rpc-lib/src/rpc-transport.c @@ -648,7 +648,7 @@ out: int rpc_transport_inet_options_build(dict_t **options, const char *hostname, - int port) + int port, char *af) { dict_t *dict = NULL; char *host = NULL; @@ -688,7 +688,7 @@ rpc_transport_inet_options_build(dict_t **options, const char *hostname, goto out; } - ret = dict_set_str(dict, "address-family", addr_family); + ret = dict_set_str(dict, "address-family", (af != NULL ? af : addr_family)); if (ret) { gf_log(THIS->name, GF_LOG_WARNING, "failed to set address-family to %s", addr_family); diff --git a/rpc/rpc-lib/src/rpc-transport.h b/rpc/rpc-lib/src/rpc-transport.h index 18412cc85f7..7be1ba14a0c 100644 --- a/rpc/rpc-lib/src/rpc-transport.h +++ b/rpc/rpc-lib/src/rpc-transport.h @@ -307,7 +307,7 @@ rpc_transport_unix_options_build(dict_t **options, char *filepath, int rpc_transport_inet_options_build(dict_t **options, const char *hostname, - int port); + int port, char *af); void rpc_transport_cleanup(rpc_transport_t *); -- cgit