diff options
author | Milind Changire <mchangir@redhat.com> | 2019-01-22 12:10:59 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-01-22 13:47:19 +0000 |
commit | b6c417785e54620331ae35d6971fe8bef98b4619 (patch) | |
tree | 828099423d2cc2cfee056b0431ebd54a205d533f /libglusterfs/src/common-utils.c | |
parent | 67bc3775685198b9ab10c1f2a0d957b157bb4acd (diff) |
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 <mchangir@redhat.com>
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r-- | libglusterfs/src/common-utils.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 4104c576fd2..0798661806d 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -503,8 +503,7 @@ gf_resolve_ip6(const char *hostname, uint16_t port, int family, void **dnscache, if ((ret = getaddrinfo(hostname, port_str, &hints, &cache->first)) != 0) { gf_msg("resolver", GF_LOG_ERROR, 0, LG_MSG_GETADDRINFO_FAILED, - "getaddrinfo failed" - " (%s)", + "getaddrinfo failed (family:%d) (%s)", family, gai_strerror(ret)); GF_FREE(*dnscache); @@ -5328,3 +5327,17 @@ gf_replace_new_iatt_in_dict(dict_t *xdata) return ret; } + +xlator_cmdline_option_t * +find_xlator_option_in_cmd_args_t(const char *option_name, cmd_args_t *args) +{ + xlator_cmdline_option_t *pos = NULL; + xlator_cmdline_option_t *tmp = NULL; + + list_for_each_entry_safe(pos, tmp, &args->xlator_options, cmd_args) + { + if (strcmp(pos->key, option_name) == 0) + return pos; + } + return NULL; +} |