forked from pool/glibc
Andreas Schwab
cc8c150f76
- getaddrinfo-uninit-result.patch: fix parsing of getai result for IPv6-only request (bnc#876521) OBS-URL: https://build.opensuse.org/request/show/232954 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=364
27 lines
825 B
Diff
27 lines
825 B
Diff
* sysdeps/posix/getaddrinfo.c (gaih_inet): Properly skip over
|
|
non-matching result from nscd.
|
|
|
|
Index: glibc-2.19/sysdeps/posix/getaddrinfo.c
|
|
===================================================================
|
|
--- glibc-2.19.orig/sysdeps/posix/getaddrinfo.c
|
|
+++ glibc-2.19/sysdeps/posix/getaddrinfo.c
|
|
@@ -712,6 +712,18 @@ gaih_inet (const char *name, const struc
|
|
{
|
|
socklen_t size = (air->family[i] == AF_INET
|
|
? INADDRSZ : IN6ADDRSZ);
|
|
+
|
|
+ if (!((air->family[i] == AF_INET
|
|
+ && req->ai_family == AF_INET6
|
|
+ && (req->ai_flags & AI_V4MAPPED) != 0)
|
|
+ || req->ai_family == AF_UNSPEC
|
|
+ || air->family[i] == req->ai_family))
|
|
+ {
|
|
+ /* Skip over non-matching result. */
|
|
+ addrs += size;
|
|
+ continue;
|
|
+ }
|
|
+
|
|
if (*pat == NULL)
|
|
{
|
|
*pat = addrfree++;
|