1 2003-10-16 Jeremy Katz <katzj@redhat.com>
3 * e-host-utils.c (e_gethostbyname_r): use AI_ADDRCONFIG if
4 available to avoid returning IPv6 addresses to hosts without an
7 Index: e-util//e-host-utils.c
8 ===================================================================
9 RCS file: /cvs/gnome/evolution/e-util/e-host-utils.c,v
10 retrieving revision 1.14.4.2
11 diff -u -u -r1.14.4.2 e-host-utils.c
12 --- e-util//e-host-utils.c 8 Oct 2003 20:36:22 -0000 1.14.4.2
13 +++ e-util//e-host-utils.c 17 Oct 2003 19:38:08 -0000
15 hints.ai_family = PF_UNSPEC;
16 hints.ai_socktype = 0;
17 hints.ai_protocol = 0;
21 + hints.ai_flags |= AI_ADDRCONFIG;
24 if ((retval = getaddrinfo (name, NULL, &hints, &res)) != 0) {
25 - *herr = ai_to_herr (retval);
28 + hints.ai_flags &= ~AI_ADDRCONFIG;
29 + if ((retval != EAI_BADFLAGS) || (retval = getaddrinfo (name, NULL, &hints, &res)) != 0) {
31 + *herr = ai_to_herr (retval);
38 len = ALIGN (strlen (res->ai_canonname) + 1);