aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/ChangeLog7
-rw-r--r--e-util/e-host-utils.c8
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);