summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/events.c')
-rw-r--r--libglusterfs/src/events.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libglusterfs/src/events.c b/libglusterfs/src/events.c
index 11b4c54c4d7..4e2f8f93a00 100644
--- a/libglusterfs/src/events.c
+++ b/libglusterfs/src/events.c
@@ -42,6 +42,7 @@ _gf_event(eventtypes_t event, const char *fmt, ...)
struct addrinfo hints;
struct addrinfo *result = NULL;
xlator_t *this = THIS;
+ int sin_family = AF_INET;
char *volfile_server_transport = NULL;
/* Global context */
@@ -84,13 +85,15 @@ _gf_event(eventtypes_t event, const char *fmt, ...)
ret = EVENT_ERROR_RESOLVE;
goto out;
}
+
+ sin_family = result->ai_family;
} else {
/* Localhost, Use the defined IP for localhost */
host = gf_strdup(EVENT_HOST);
}
/* Socket Configurations */
- server.sin_family = AF_INET;
+ server.sin_family = sin_family;
server.sin_port = htons(EVENT_PORT);
ret = inet_pton(server.sin_family, host, &server.sin_addr);
if (ret <= 0) {