diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-10-25 05:59:47 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-10-25 05:59:47 +0800 |
commit | 7e0411b4647fea7bebfe7d15a0edf923b88c5e9c (patch) | |
tree | e9e7f92f5bcf11293c3e3ac84543f9e70ae6ddd3 | |
parent | b884a6479092f8e67285c8dd959e49ecd330ce04 (diff) | |
download | gsoc2013-evolution-7e0411b4647fea7bebfe7d15a0edf923b88c5e9c.tar gsoc2013-evolution-7e0411b4647fea7bebfe7d15a0edf923b88c5e9c.tar.gz gsoc2013-evolution-7e0411b4647fea7bebfe7d15a0edf923b88c5e9c.tar.bz2 gsoc2013-evolution-7e0411b4647fea7bebfe7d15a0edf923b88c5e9c.tar.lz gsoc2013-evolution-7e0411b4647fea7bebfe7d15a0edf923b88c5e9c.tar.xz gsoc2013-evolution-7e0411b4647fea7bebfe7d15a0edf923b88c5e9c.tar.zst gsoc2013-evolution-7e0411b4647fea7bebfe7d15a0edf923b88c5e9c.zip |
If the system defines AI_ADDRCONFIG, set this flag on the hints.ai_flags
2003-10-17 Jeffrey Stedfast <fejj@ximian.com>
* e-host-utils.c (e_gethostbyname_r): If the system defines
AI_ADDRCONFIG, set this flag on the hints.ai_flags member as well
so that we don't resolve a host to an IPv6 addr when the node
doesn't have any IPv6 source addresses.
svn path=/trunk/; revision=23077
-rw-r--r-- | e-util/ChangeLog | 7 | ||||
-rw-r--r-- | e-util/e-host-utils.c | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 39b002ea38..2c680bfcde 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,10 @@ +2003-10-17 Jeffrey Stedfast <fejj@ximian.com> + + * e-host-utils.c (e_gethostbyname_r): If the system defines + AI_ADDRCONFIG, set this flag on the hints.ai_flags member as well + so that we don't resolve a host to an IPv6 addr when the node + doesn't have any IPv6 source addresses. + 2003-10-24 Dan Winship <danw@ximian.com> * Makefile.am (libedb3util_la_LIBADD): add $(DB3_LDADD) diff --git a/e-util/e-host-utils.c b/e-util/e-host-utils.c index c4057113df..4ca2daa6dc 100644 --- a/e-util/e-host-utils.c +++ b/e-util/e-host-utils.c @@ -183,10 +183,14 @@ e_gethostbyname_r (const char *name, struct hostent *host, char *addr; memset (&hints, 0, sizeof (struct addrinfo)); +#ifdef HAVE_AI_ADDRCONFIG + hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG; +#else hints.ai_flags = AI_CANONNAME; +#endif hints.ai_family = PF_UNSPEC; - hints.ai_socktype = 0; - hints.ai_protocol = 0; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; if ((retval = getaddrinfo (name, NULL, &hints, &res)) != 0) { *herr = ai_to_herr (retval); |