Bump versions.
[libidn.git] / libc / libc.patch
blob82f98cc52e70d794f61b9a35129f1fda530d23cc
1 Index: sysdeps/posix/getaddrinfo.c
2 ===================================================================
3 RCS file: /cvs/glibc/libc/sysdeps/posix/getaddrinfo.c,v
4 retrieving revision 1.45
5 diff -u -p -r1.45 getaddrinfo.c
6 --- sysdeps/posix/getaddrinfo.c 17 Dec 2002 01:14:48 -0000 1.45
7 +++ sysdeps/posix/getaddrinfo.c 12 Sep 2003 20:26:48 -0000
8 @@ -51,6 +51,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
9 #include <sys/utsname.h>
10 #include <net/if.h>
11 #include <nsswitch.h>
12 +#include <idna.h>
14 #define GAIH_OKIFUNSPEC 0x0100
15 #define GAIH_EAI ~(GAIH_OKIFUNSPEC)
16 @@ -486,6 +487,15 @@ gaih_inet (const char *name, const struc
17 at->scopeid = 0;
18 at->next = NULL;
20 + if (req->ai_flags & AI_IDN)
21 + {
22 + char *p;
23 + rc = idna_to_ascii_lz (name, &p, 0);
24 + if (rc != IDNA_SUCCESS)
25 + return -EAI_IDN_ENCODE;
26 + name = p; /* XXX memory leak */
27 + }
29 if (inet_pton (AF_INET, name, at->addr) > 0)
31 if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET)
32 @@ -844,10 +854,10 @@ getaddrinfo (const char *name, const cha
33 if (hints == NULL)
34 hints = &default_hints;
36 - if (hints->ai_flags & ~(AI_PASSIVE|AI_CANONNAME|AI_NUMERICHOST))
37 + if (hints->ai_flags & ~(AI_PASSIVE|AI_CANONNAME|AI_NUMERICHOST|AI_IDN))
38 return EAI_BADFLAGS;
40 - if ((hints->ai_flags & AI_CANONNAME) && name == NULL)
41 + if ((hints->ai_flags & (AI_CANONNAME|AI_IDN)) && name == NULL)
42 return EAI_BADFLAGS;
44 if (service && service[0])
45 Index: resolv/netdb.h
46 ===================================================================
47 RCS file: /cvs/glibc/libc/resolv/netdb.h,v
48 retrieving revision 1.40
49 diff -u -p -r1.40 netdb.h
50 --- resolv/netdb.h 8 Aug 2002 21:17:03 -0000 1.40
51 +++ resolv/netdb.h 12 Sep 2003 20:26:48 -0000
52 @@ -424,6 +424,11 @@ struct gaicb
53 # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
54 # define AI_CANONNAME 0x0002 /* Request for canonical name. */
55 # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
56 +# ifdef __USE_GNU
57 +# define AI_IDN 0x0008 /* IDN encode input (assuming it is encoded
58 + in the current locale's character set)
59 + before looking it up. */
60 +# endif
62 /* Error values for `getaddrinfo' function. */
63 # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
64 @@ -443,6 +448,7 @@ struct gaicb
65 # define EAI_NOTCANCELED -102 /* Request not canceled. */
66 # define EAI_ALLDONE -103 /* All requests done. */
67 # define EAI_INTR -104 /* Interrupted by a signal. */
68 +# define EAI_IDN_ENCODE -105 /* IDN encoding of input failed. */
69 # endif
71 # define NI_MAXHOST 1025