Fix parsing of getai result from nscd for IPv6-only request
This commit is contained in:
parent
a11892631d
commit
8dc9751764
|
@ -1,7 +1,13 @@
|
||||||
|
2014-05-07 Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
* sysdeps/posix/getaddrinfo.c (gaih_inet): Advance address pointer
|
||||||
|
when skipping over non-matching result from nscd.
|
||||||
|
|
||||||
2014-05-07 Ondřej Bílka <neleai@seznam.cz>
|
2014-05-07 Ondřej Bílka <neleai@seznam.cz>
|
||||||
|
|
||||||
[BZ #16876]
|
[BZ #16876]
|
||||||
* nptl/sockperf.c (client): Check socket return value.
|
* nptl/sockperf.c (client): Check socket return value.
|
||||||
|
|
||||||
[BZ #16877]
|
[BZ #16877]
|
||||||
* nscd/selinux.c (nscd_request_avc_has_perm): Check if there is
|
* nscd/selinux.c (nscd_request_avc_has_perm): Check if there is
|
||||||
nscd security class.
|
nscd security class.
|
||||||
|
|
|
@ -710,16 +710,20 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
||||||
struct gaih_addrtuple *addrfree = addrmem;
|
struct gaih_addrtuple *addrfree = addrmem;
|
||||||
for (int i = 0; i < air->naddrs; ++i)
|
for (int i = 0; i < air->naddrs; ++i)
|
||||||
{
|
{
|
||||||
|
socklen_t size = (air->family[i] == AF_INET
|
||||||
|
? INADDRSZ : IN6ADDRSZ);
|
||||||
|
|
||||||
if (!((air->family[i] == AF_INET
|
if (!((air->family[i] == AF_INET
|
||||||
&& req->ai_family == AF_INET6
|
&& req->ai_family == AF_INET6
|
||||||
&& (req->ai_flags & AI_V4MAPPED) != 0)
|
&& (req->ai_flags & AI_V4MAPPED) != 0)
|
||||||
|| req->ai_family == AF_UNSPEC
|
|| req->ai_family == AF_UNSPEC
|
||||||
|| air->family[i] == req->ai_family))
|
|| air->family[i] == req->ai_family))
|
||||||
|
{
|
||||||
/* Skip over non-matching result. */
|
/* Skip over non-matching result. */
|
||||||
|
addrs += size;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
socklen_t size = (air->family[i] == AF_INET
|
|
||||||
? INADDRSZ : IN6ADDRSZ);
|
|
||||||
if (*pat == NULL)
|
if (*pat == NULL)
|
||||||
{
|
{
|
||||||
*pat = addrfree++;
|
*pat = addrfree++;
|
||||||
|
|
Loading…
Reference in New Issue