diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | sysdeps/posix/getaddrinfo.c | 8 |
3 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index ab98fa699e..d406f350cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-03-20 Andreas Schwab <schwab@suse.de> + + [BZ #16743] + * sysdeps/posix/getaddrinfo.c (gaih_inet): Properly skip over + non-matching result from nscd. + 2014-03-24 Siddhesh Poyarekar <siddhesh@redhat.com> * scripts/bench.py: Moved to ... diff --git a/NEWS b/NEWS index 94183905c0..a5540f133d 100644 --- a/NEWS +++ b/NEWS @@ -11,7 +11,8 @@ Version 2.20 15347, 15804, 15894, 16002, 16284, 16447, 16532, 16545, 16574, 16600, 16609, 16610, 16611, 16613, 16623, 16632, 16639, 16642, 16649, 16670, - 16674, 16677, 16680, 16683, 16689, 16695, 16701, 16706, 16707, 16731. + 16674, 16677, 16680, 16683, 16689, 16695, 16701, 16706, 16707, 16731, + 16743. * Running the testsuite no longer terminates as soon as a test fails. Instead, a file tests.sum (xtests.sum from "make xcheck") is generated, diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index e1a399b3ca..3385bed333 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -710,6 +710,14 @@ gaih_inet (const char *name, const struct gaih_service *service, struct gaih_addrtuple *addrfree = addrmem; for (int i = 0; i < air->naddrs; ++i) { + 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. */ + continue; + socklen_t size = (air->family[i] == AF_INET ? INADDRSZ : IN6ADDRSZ); if (*pat == NULL) |