[PATCH] resolv: Disable TCP servers in tst-resolv-res_init-failure

Florian Weimer <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <[email protected]>
This avoids spurious xaccept errors on slow systems.

---
 resolv/tst-resolv-res_init-failure.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/resolv/tst-resolv-res_init-failure.c b/resolv/tst-resolv-res_init-failure.c
index d20348acf2..ae782c3f12 100644
--- a/resolv/tst-resolv-res_init-failure.c
+++ b/resolv/tst-resolv-res_init-failure.c
@@ -66,7 +66,20 @@ static int
 do_test (void)
 {
   struct resolv_test *aux = resolv_test_start
-    ((struct resolv_redirect_config) { .response_callback = response });
+    ((struct resolv_redirect_config)
+     {
+       .response_callback = response,
+       /* Disable TCP servers.  The kernel pre-allocates the client FD
+	  in the accept system call, leading to accept failures if
+	  setrlimit below completes before TCP accept setup on the TCP
+	  DNS server threads.  */
+       .servers =
+	 {
+	   { .disable_tcp = true, },
+	   { .disable_tcp = true, },
+	   { .disable_tcp = true, },
+	 },
+     });
 
   /* Initial lookup.  This drives __res_context_send through its init
      block, which allocates _u._ext.nsaddrs[] and sets

base-commit: 249639137ed360d1827d9e663261ba26d2b01d81
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.