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

Andreas K. Huettel dilfridge@gentoo.org
Mon Jul 20 15:05:41 GMT 2026


Am Montag, 20. Juli 2026, 23:27:46 Japanische Normalzeit schrieben Sie:
> This avoids spurious xaccept errors on slow systems.
> 

Well, I cannot confirm with certainty that this does what it's advertised to 
do, but the code makes sense and looks correct to exclude the TCP path...

> ---
>  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
> 
> 


-- 
PD Dr. Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer 
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 870 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20260721/0a2943e9/attachment.sig>


More information about the Libc-alpha mailing list