[evolution-patches] Re: [gene-pool] [Fwd: [Fwd: evolution and ipv6]]



this was mentioned on fedora-beta-list the other day as well... the problem is that getaddrinfo() is resolving the hostname to an IPv6 addr rather than the IPv4 addr. Supposedly adding the AI_ADDRCONFIG flag to the hints will "fix" this. But low-and-behold, this flag is not actually available on anything except fedora linux (certainly not available on rh7.2, 8.0, or 9.0 - I checked).

I've actually already got a patch for this, but I don't really know if it works like Ulrich claims it will. nor does the online manual really explain how this works.

as far as I understand the man pages on getaddrinfo(), if I set hints.ai_family to PF_UNSPEC - it is *supposed* to use whatever the system is configued to use for the input hostname. but apparently that isn't the case. yay.

If the AI_ADDRCONFIG flag is specified then a query for AAAA or A6
records occurs only if the node has at least one IPv6 source address
configured and a query for A records occurs only if the node has at least
one IPv4 source address configured.  The loopback address is not
considered for this case as valid as a configured sources address.

Sounds safe enough I guess, but this flag isn't available on most systems it seems.

Anyways, patch attached.

On Fri, 2003-10-17 at 12:13, Ettore Perazzoli wrote:
Any idea on this?

-- 
Ettore Perazzoli <ettore ximian com>

From: Carlos <carlos ximian com>
To: ettore ximian com
Subject: [Fwd: evolution and ipv6]
Date: Fri, 17 Oct 2003 11:08:12 -0400


question from SuSE.

thanks

carlos

-- 
Carlos E. Montero-Luque				carlos ximian com
VP, Engineering					direct: +1.617.375.3876
Novell Ximian Services				cell:   +1.617.852.1731
http://www.novell.com				"Plus Ultra"

From: Karine Nguyen <karine suse de>
To: Carlos <carlos ximian com>
Subject: evolution and ipv6
Date: Fri, 17 Oct 2003 13:42:25 +0200


Hi Carlos,

i have read in our internal users forum that evolution 1.4.4 (the version
on SUSE LINUX 9.0), when trying to connecting to a server which has an
ipv6 address (using its host name), will fail instead of trying to connect
using ipv4. Im not sure if the bug has already been reported, so i just
send it to you, just delete if it is an old one.

cheers,
karine
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/ChangeLog,v
retrieving revision 1.1215.2.10
diff -u -r1.1215.2.10 ChangeLog
--- ChangeLog	26 Sep 2003 23:54:10 -0000	1.1215.2.10
+++ ChangeLog	17 Oct 2003 16:30:43 -0000
@@ -1,3 +1,7 @@
+2003-10-17  Jeffrey Stedfast  <fejj ximian com>
+
+	* configure.in: added a configure check for AI_ADDRCONFIG
+
 2003-09-27  Laurent Dhima  <laurenti alblinux net>
 
 	* configure.in: Added "sq" to ALL_LINGUAS.
Index: configure.in
===================================================================
RCS file: /cvs/gnome/evolution/configure.in,v
retrieving revision 1.591.2.8
diff -u -r1.591.2.8 configure.in
--- configure.in	26 Sep 2003 23:52:36 -0000	1.591.2.8
+++ configure.in	17 Oct 2003 16:30:45 -0000
@@ -284,6 +284,20 @@
 
 if test "x$enable_ipv6" = "xyes"; then
 	AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
+	AC_TRY_COMPILE([
+		#include "confdefs.h"
+		#include <sys/types.h>
+		#include <sys/socket.h>
+		#include <netinet/in.h>
+		#include <netdb.h>
+
+	],[
+		struct addrinfo hints;
+		
+		hints.ai_flags = AI_ADDRCONFIG;
+	],[
+		AC_DEFINE(HAVE_AI_ADDRCONFIG,1,[Define if the system defines the AI_ADDRCONFIG flag for getaddrinfo])
+	])
 fi
 AM_CONDITIONAL(ENABLE_IPv6, test "x$enable_ipv6" = "xyes")
 
@@ -358,7 +372,7 @@
 	ac_cv_db3_ldadd=""
 
 	for name in db db3 db-3.1; do
-		LIBS="$LIBS_save $with_db3_libs/lib${name}.a"
+		LIBS="$LIBS_save $with_db3_libs/lib${name}.a -pthread"
 		AC_TRY_LINK([
 			#ifdef HAVE_DB3_DB_H
 			#include <db3/db.h>
@@ -384,7 +398,7 @@
 
 AC_CACHE_CHECK([that db3 library version matches header version], ac_cv_db3_lib_version_match,
 [
-	LIBS="$DB3_LDADD $LIBS"
+	LIBS="$DB3_LDADD $LIBS -pthread"
 	AC_TRY_RUN([
 		#ifdef HAVE_DB3_DB_H
 		#include <db3/db.h>
Index: e-util/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/e-util/ChangeLog,v
retrieving revision 1.398.2.8
diff -u -r1.398.2.8 ChangeLog
--- e-util/ChangeLog	8 Oct 2003 20:36:22 -0000	1.398.2.8
+++ e-util/ChangeLog	17 Oct 2003 16:30:45 -0000
@@ -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-09-19  Jeffrey Stedfast  <fejj ximian com>
 
 	* e-host-utils.c (e_gethostbyaddr_r): Work around a bug in glibc
Index: e-util/e-host-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-host-utils.c,v
retrieving revision 1.14.4.2
diff -u -r1.14.4.2 e-host-utils.c
--- e-util/e-host-utils.c	8 Oct 2003 20:36:22 -0000	1.14.4.2
+++ e-util/e-host-utils.c	17 Oct 2003 16:30:45 -0000
@@ -183,10 +183,14 @@
 	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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]