glibc/glibc-rh168253-getaddrinfo-tests-bug21295.patch
Florian Weimer 8597553f96 Rebase DNS stub resolver to the glibc 2.26 version
- Support an arbitrary number of search domains (#168253)
- Detect and apply /etc/resolv.conf changes in libresolv (#1374239)
- CVE-2015-5180: DNS stub resolver crash with crafted record type (#1251403)
2017-10-11 14:41:27 +02:00

34 lines
1.3 KiB
Diff

commit 513a71a420e74270a6a9702ec916e807be51350a
Author: Florian Weimer <fweimer@redhat.com>
Date: Sat Jun 24 16:51:31 2017 +0200
resolv/tst-resolv-basic: Add test cases for bug 21295
diff --git a/resolv/tst-resolv-basic.c b/resolv/tst-resolv-basic.c
index 92f912beed35744f..3dfa1657f50ab588 100644
--- a/resolv/tst-resolv-basic.c
+++ b/resolv/tst-resolv-basic.c
@@ -398,6 +398,22 @@ do_test (void)
check_ai ("t.nxdomain.example", "80", AF_INET6,
"error: Name or service not known\n");
+ /* Test for bug 21295. */
+ check_ai_hints ("www.example", "80",
+ (struct addrinfo) { .ai_family = AF_INET6,
+ .ai_socktype = SOCK_STREAM,
+ .ai_flags = AI_V4MAPPED | AI_ALL, },
+ "flags: AI_V4MAPPED AI_ALL\n"
+ "address: STREAM/TCP 2001:db8::1 80\n"
+ "address: STREAM/TCP ::ffff:192.0.2.17 80\n");
+ check_ai_hints ("t.www.example", "80",
+ (struct addrinfo) { .ai_family = AF_INET6,
+ .ai_socktype = SOCK_STREAM,
+ .ai_flags = AI_V4MAPPED | AI_ALL, },
+ "flags: AI_V4MAPPED AI_ALL\n"
+ "address: STREAM/TCP 2001:db8::3 80\n"
+ "address: STREAM/TCP ::ffff:192.0.2.19 80\n");
+
resolv_test_end (aux);
return 0;