This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Sun May 19 15:01:43 2024 Received: from spaans.ds9a.nl (adsl-xs4all.ds9a.nl [213.84.159.51]) by kylie.puddingonline.com (8.11.6/8.11.6) with SMTP id g8HJrBi23189 for ; Tue, 17 Sep 2002 21:53:12 +0200 Received: (qmail 3934 invoked from network); 17 Sep 2002 19:40:31 -0000 Received: from unknown (HELO spaans.ds9a.nl) (3ffe:8280:10:360:202:44ff:fe2a:a1dd) by mayo.ipv6.ds9a.nl with SMTP; 17 Sep 2002 19:40:31 -0000 Received: (qmail 6322 invoked by uid 1000); 17 Sep 2002 19:40:21 -0000 MBOX-Line: From linux-kernel-owner@vger.kernel.org Mon Sep 04 20:28:44 2000 Received: (maildatabase); juh Received: (qmail 3350 invoked by alias); 4 Sep 2000 20:28:44 -0000 Received: (qmail 3347 invoked from network); 4 Sep 2000 20:28:44 -0000 Received: from vger.kernel.org (199.183.24.194) by spaans.ds9a.nl with SMTP; 4 Sep 2000 20:28:44 -0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 4 Sep 2000 16:39:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 4 Sep 2000 16:39:03 -0400 Received: from challah.msrl.com ([198.176.193.209]:8661 "HELO challah.msrl.com") by vger.kernel.org with SMTP id ; Mon, 4 Sep 2000 16:38:57 -0400 Received: (qmail 31836 invoked by uid 1000); 4 Sep 2000 20:27:53 -0000 To: linux-kernel@vger.kernel.org Subject: Should O_NONBLOCK be copied from listening socket to accepting socket? From: Michael Shields Organization: Mad Science Research Labs Date: 04 Sep 2000 20:27:53 +0000 Message-Id: <8766obaomu.fsf@challah.msrl.com> Lines: 62 User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Capitol Reef) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Is it required that the O_NONBLOCK flag be copied from a listening socket to an accepted socket? Dan Bernstein believes this is a bug. --=-=-= Content-Type: message/rfc822 Content-Disposition: inline X-From-Line: dns-return-3702-shields=msrl.com@list.cr.yp.to Mon Sep 04 19:39:37 2000 Return-Path: Delivered-To: shields@challah.msrl.com Received: (qmail 30817 invoked by alias); 4 Sep 2000 19:39:37 -0000 Delivered-To: alias-msrl-shields@msrl.com Received: (qmail 30814 invoked from network); 4 Sep 2000 19:39:37 -0000 Received: from koobera.math.uic.edu (HELO muncher.math.uic.edu) (131.193.178.181) by challah.msrl.com with SMTP; 4 Sep 2000 19:39:37 -0000 Received: (qmail 1948 invoked by uid 1002); 4 Sep 2000 19:39:40 -0000 Mailing-List: contact dns-help@list.cr.yp.to; run by ezmlm Delivered-To: mailing list dns@list.cr.yp.to Received: (qmail 25369 invoked by uid 1001); 4 Sep 2000 19:39:40 -0000 Date: 4 Sep 2000 19:39:40 -0000 Message-ID: <20000904193940.20671.qmail@cr.yp.to> Mail-Followup-To: dns@list.cr.yp.to From: "D. J. Bernstein" To: dns@list.cr.yp.to Subject: Re: [dnscache] problems (hanging) when lookup-cache full? References: <20000902214411.22566.qmail@cr.yp.to> <20000904102753.2572.0@argo.troja.mff.cuni.cz> Lines: 32 Xref: challah.msrl.com djb-dns:2698 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Pavel Kankovsky writes: > What happens when x->tcpstate == 1 (i.e. waiting for the first byte of TCP > request length), x->io->revents == 0 (i.e. not ready for i/o), and > !taia_less(stamp, &x->timeout) (i.e. the timeout has expired)? What happens on working kernels is that the read() returns -1/35, because that descriptor is nonblocking. For example, under OpenBSD: % time telnet 127.0.0.1 53 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Connection closed by foreign host. 0.0u 0.0s 0:10.02 0.0% 0+0k 0+3io 0pf+0w Apparently Linux 2.2 fails to copy O_NONBLOCK from the listening socket to the accepted socket, so the same test will block dnscache after 10 seconds; you'll have to close the connection manually. I'd appreciate hearing exactly which kernel versions have this bug. Obvious workaround #1: add if (ndelay_on(x->tcp) == -1) { close(x->tcp); return; } /* Linux bug */ two lines after the accept4() in dnscache.c. Obvious workaround #2: use a system with the BSD networking stack. (Can't beat the Real Thing.) Thanks to Pavel for tracking this down. No thanks to Ray for giving us a bogus diagnosis instead of the crucial logs. ---Dan --=-=-= -- Shields. --=-=-=-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/