[svn] Stop using AI_ADDRCONFIG.

This commit is contained in:
hniksic 2005-06-17 09:48:29 -07:00
parent a207436528
commit e2e349b2ca
4 changed files with 11 additions and 42 deletions

View File

@ -1,3 +1,10 @@
2005-06-17 Hrvoje Niksic <hniksic@xemacs.org>
* connect.c (socket_has_inet6): Removed.
* host.c (lookup_host): Don't use the AI_ADDRCONFIG getaddrinfo
hint.
2005-06-16 Hrvoje Niksic <hniksic@xemacs.org>
* init.c (cmd_lockable_boolean): Improve the error message so it

View File

@ -608,37 +608,6 @@ retryable_socket_connect_error (int err)
return 1;
}
#ifdef ENABLE_IPV6
# ifndef HAVE_GETADDRINFO_AI_ADDRCONFIG
/* Return non-zero if the INET6 socket family is supported on the
system.
This doesn't guarantee that we're able to connect to IPv6 hosts,
but it's better than nothing. It is only used on systems where
getaddrinfo doesn't support AI_ADDRCONFIG. (See lookup_host.) */
int
socket_has_inet6 (void)
{
static int supported = -1;
if (supported == -1)
{
int sock = socket (AF_INET6, SOCK_STREAM, 0);
if (sock < 0)
supported = 0;
else
{
fd_close (sock);
supported = 1;
}
}
return supported;
}
# endif/* not HAVE_GETADDRINFO_AI_ADDRCONFIG */
#endif /* ENABLE_IPV6 */
/* Wait for a single descriptor to become available, timing out after
MAXTIME seconds. Returns 1 if FD is available, 0 for timeout and
-1 for error. The argument WAIT_FOR can be a combination of

View File

@ -59,7 +59,6 @@ enum {
};
int select_fd PARAMS ((int, double, int));
int test_socket_open PARAMS ((int));
int socket_has_inet6 PARAMS ((void));
typedef int (*fd_reader_t) PARAMS ((int, char *, int, void *));
typedef int (*fd_writer_t) PARAMS ((int, char *, int, void *));

View File

@ -767,17 +767,11 @@ lookup_host (const char *host, int flags)
else if (opt.ipv6_only)
hints.ai_family = AF_INET6;
else
{
/* We used to specify AI_ADDRCONFIG here, but removed it because
it fails in on systems with IPv6 loopbacks, it loses on AIX
5.1, and isn't really needed as we sort the addresses). */
hints.ai_family = AF_UNSPEC;
#ifdef AI_ADDRCONFIG
hints.ai_flags |= AI_ADDRCONFIG;
#else
/* On systems without AI_ADDRCONFIG, emulate it by manually
checking whether the system supports IPv6 sockets. */
if (!socket_has_inet6 ())
hints.ai_family = AF_INET;
#endif
}
if (flags & LH_BIND)
hints.ai_flags |= AI_PASSIVE;