From 58c5e9feae1fdf618bb120f4c8ea318cc628dd06 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 13 Sep 2011 12:11:52 +0530 Subject: 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 Reviewed-by: Vijay Bellur --- rpc/rpc-transport/socket/src/name.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc/rpc-transport') diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c index 69678ed9fa..8de1c5fcd4 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) { -- cgit