summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2016-04-16 07:46:40 +0530
committerKaushal M <kaushal@redhat.com>2016-04-16 07:48:23 +0530
commit95cd42ebda087343ecb7267fa1fd5ac129c756e1 (patch)
tree43a1d3ebdd87a3ebfa860aba339d288e72e39d6e /libglusterfs
parent1c62ca12df86eedf130de679ac99638a9d0ad82d (diff)
Revert "glusterd: Bug fixes for IPv6 support"
This reverts commit b33f3c95ec9c8112e6677e09cea05c4c462040d0. This commit exposes some issues with management encryption that prevents GlusterFS from operating properly. This will be added again once problems with management encryption are fixed.
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c35
-rw-r--r--libglusterfs/src/common-utils.h6
2 files changed, 11 insertions, 30 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index e3293dc..81e01bf 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -59,6 +59,11 @@
typedef int32_t (*rw_op_t)(int32_t fd, char *buf, int32_t size);
typedef int32_t (*rwv_op_t)(int32_t fd, const struct iovec *buf, int32_t size);
+struct dnscache6 {
+ struct addrinfo *first;
+ struct addrinfo *next;
+};
+
void
md5_wrapper(const unsigned char *data, size_t len, char *md5)
{
@@ -287,6 +292,9 @@ gf_resolve_ip6 (const char *hostname,
memset(&hints, 0, sizeof(hints));
hints.ai_family = family;
hints.ai_socktype = SOCK_STREAM;
+#ifndef __NetBSD__
+ hints.ai_flags = AI_ADDRCONFIG;
+#endif
ret = gf_asprintf (&port_str, "%d", port);
if (-1 == ret) {
@@ -2185,14 +2193,6 @@ valid_ipv6_address (char *address, int length, gf_boolean_t wildcard_acc)
tmp = gf_strdup (address);
- /* Check for '%' for link local addresses */
- endptr = strchr(tmp, '%');
- if (endptr) {
- *endptr = '\0';
- length = strlen(tmp);
- endptr = NULL;
- }
-
/* Check for compressed form */
if (length <= 0 || tmp[length - 1] == ':') {
ret = 0;
@@ -3118,18 +3118,9 @@ gf_is_local_addr (char *hostname)
gf_boolean_t found = _gf_false;
char *ip = NULL;
xlator_t *this = NULL;
- struct addrinfo hints;
this = THIS;
-
- memset (&hints, 0, sizeof (hints));
- /*
- * Removing AI_ADDRCONFIG from default_hints
- * for being able to use link local ipv6 addresses
- */
- hints.ai_family = AF_UNSPEC;
-
- ret = getaddrinfo (hostname, NULL, &hints, &result);
+ ret = getaddrinfo (hostname, NULL, NULL, &result);
if (ret != 0) {
gf_msg (this->name, GF_LOG_ERROR, 0, LG_MSG_GETADDRINFO_FAILED,
@@ -3169,19 +3160,15 @@ gf_is_same_address (char *name1, char *name2)
struct addrinfo *q = NULL;
gf_boolean_t ret = _gf_false;
int gai_err = 0;
- struct addrinfo hints;
-
- memset (&hints, 0, sizeof (hints));
- hints.ai_family = AF_UNSPEC;
- gai_err = getaddrinfo(name1, NULL, &hints, &addr1);
+ gai_err = getaddrinfo(name1,NULL,NULL,&addr1);
if (gai_err != 0) {
gf_msg (name1, GF_LOG_WARNING, 0, LG_MSG_GETADDRINFO_FAILED,
"error in getaddrinfo: %s\n", gai_strerror(gai_err));
goto out;
}
- gai_err = getaddrinfo(name2, NULL, &hints, &addr2);
+ gai_err = getaddrinfo(name2,NULL,NULL,&addr2);
if (gai_err != 0) {
gf_msg (name2, GF_LOG_WARNING, 0, LG_MSG_GETADDRINFO_FAILED,
"error in getaddrinfo: %s\n", gai_strerror(gai_err));
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index c152540..e374285 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -165,12 +165,6 @@ typedef struct dht_changelog_rename_info {
char buffer[1];
} dht_changelog_rename_info_t;
-struct dnscache6 {
- struct addrinfo *first;
- struct addrinfo *next;
-};
-
-
typedef int (*gf_cmp) (void *, void *);