summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-09-13 12:11:52 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-13 00:04:33 -0700
commit58c5e9feae1fdf618bb120f4c8ea318cc628dd06 (patch)
tree40e3bfb5e7d07d56c934d81d110fb955a77b02ed /rpc/rpc-transport
parenta07bb18c8adeb8597f62095c5d1361c5bad01f09 (diff)
socket: provide proper arguments to getaddrinfo
----- from 'man getaddrinfo' : If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4 addresses are returned in the list pointed to by res only if the local system has at least one IPv4 address configured, and IPv6 addresses are only returned if the local system has at least one IPv6 address configured. ----- Change-Id: Ie30344daf1bb9d41ac58741b38e83af35cd8b5e9 BUG: 2456 Reviewed-on: http://review.gluster.com/405 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'rpc/rpc-transport')
-rw-r--r--rpc/rpc-transport/socket/src/name.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c
index 69678ed9fae..8de1c5fcd42 100644
--- a/rpc/rpc-transport/socket/src/name.c
+++ b/rpc/rpc-transport/socket/src/name.c
@@ -402,7 +402,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;
+ hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
ret = getaddrinfo(listen_host, service, &hints, &res);
if (ret != 0) {