summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorNithin D <nithind1988@yahoo.in>2015-11-15 22:14:43 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-02-20 09:16:42 -0800
commit46bd29e0f2a7fc9278068a06d12066d614f365ec (patch)
tree52cbc91d42b513d9d128dc23ac7d47fa1cb5211e /rpc
parent759b63536c676f4b4fa135ea62d74dff021778e4 (diff)
glusterd: Bug fixes for IPv6 support
Problem: Glusterd not working using ipv6 transport. The idea is with proper glusterd.vol configuration, 1. glusterd needs to listen on default port (240007) as IPv6 TCP listner. 2. Volume creation/deletion/mounting/add-bricks/delete-bricks/peer-probe needs to work using ipv6 addresses. 3. Bricks needs to listen on ipv6 addresses. All the above functionality is needed to say that glusterd supports ipv6 transport and this is broken. Fix: When "option transport.address-family inet6" option is present in glusterd.vol file, it is made sure that glusterd creates listeners using ipv6 sockets only and also the same information is saved inside brick volume files used by glusterfsd brick process when they are starting. Tests Run: Regression tests using ./run-tests.sh IPv4: Ran manually till tests/basic/rpm.t . IPv6: (Need to add the above mentioned config and also add an entry for "hostname ::1" in /etc/hosts) Started failing at ./tests/basic/glusterd/arbiter-volume-probe.t and ran successfully till here Unit Tests using Ipv6 peer probe add-bricks remove-bricks create volume replace-bricks start volume stop volume delete volume Change-Id: Iebc96e6cce748b5924ce5da17b0114600ec70a6e BUG: 1117886 Signed-off-by: Nithin D <nithind1988@yahoo.in> Reviewed-on: http://review.gluster.org/11988 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c6
-rw-r--r--rpc/rpc-transport/socket/src/name.c9
2 files changed, 5 insertions, 10 deletions
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index 0f1351fe91a..ca5d51488f2 100644
--- a/rpc/rpc-lib/src/rpc-transport.c
+++ b/rpc/rpc-lib/src/rpc-transport.c
@@ -687,12 +687,6 @@ rpc_transport_inet_options_build (dict_t **options, const char *hostname,
"failed to set remote-port with %d", port);
goto out;
}
- ret = dict_set_str (dict, "transport.address-family", "inet");
- if (ret) {
- gf_log (THIS->name, GF_LOG_WARNING,
- "failed to set addr-family with inet");
- goto out;
- }
ret = dict_set_str (dict, "transport-type", "socket");
if (ret) {
diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c
index 650c5a747be..a8cf04d8ab7 100644
--- a/rpc/rpc-transport/socket/src/name.c
+++ b/rpc/rpc-transport/socket/src/name.c
@@ -149,9 +149,10 @@ client_fill_address_family (rpc_transport_t *this, sa_family_t *sa_family)
if (remote_host_data) {
gf_log (this->name, GF_LOG_DEBUG,
- "address-family not specified, guessing it "
- "to be inet from (remote-host: %s)", data_to_str (remote_host_data));
- *sa_family = AF_INET;
+ "address-family not specified, marking it as unspec "
+ "for getaddrinfo to resolve from (remote-host: %s)",
+ data_to_str(remote_host_data));
+ *sa_family = AF_UNSPEC;
} else {
gf_log (this->name, GF_LOG_DEBUG,
"address-family not specified, guessing it "
@@ -395,7 +396,7 @@ af_inet_server_get_local_sockaddr (rpc_transport_t *this,
memset (&hints, 0, sizeof (hints));
hints.ai_family = addr->sa_family;
hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
+ hints.ai_flags = AI_PASSIVE;
ret = getaddrinfo(listen_host, service, &hints, &res);
if (ret != 0) {