From owner-freebsd-net@FreeBSD.ORG Wed Jun 23 01:23:58 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4195116A4CE; Wed, 23 Jun 2004 01:23:58 +0000 (GMT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 064CE43D54; Wed, 23 Jun 2004 01:23:58 +0000 (GMT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 8C43965216; Wed, 23 Jun 2004 02:23:56 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 74369-02-3; Wed, 23 Jun 2004 02:23:55 +0100 (BST) Received: from empiric.dek.spc.org (82-147-17-88.dsl.uk.rapidplay.com [82.147.17.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 79AA86520F; Wed, 23 Jun 2004 02:23:55 +0100 (BST) Received: by empiric.dek.spc.org (Postfix, from userid 1001) id E0A95614B; Wed, 23 Jun 2004 02:23:54 +0100 (BST) Date: Wed, 23 Jun 2004 02:23:54 +0100 From: Bruce M Simpson To: Robert Watson Message-ID: <20040623012354.GQ762@empiric.dek.spc.org> Mail-Followup-To: Robert Watson , freebsd-net@freebsd.org, Jayanth Vijayaraghavan References: <20040623005802.GO762@empiric.dek.spc.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-net@freebsd.org Subject: Re: kern/45733: file descriptor flags and socket flags out of sync X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2004 01:23:58 -0000 On Tue, Jun 22, 2004 at 09:04:35PM -0400, Robert Watson wrote: > Since you're looking at the propagation of head so_state to new socket > so_state, you might want to look at the similar statement in sonewconn(), > which copies so_state from head to the new socket, and adds the SS_NOFDREF > flag. Should we only be propagating SS_NBIO here as well? Verdict: not proven. SS_NOFDREF implies that no file descriptor references the socket, so similar inconsistencies between the FD and the SO wouldn't apply here. The state of the socket 'head' is likely to be consistent with regards to the other SS_* flags as 'head' is a listening socket, and such sockets don't generally appear to be used for straight I/O from userland (in the PF_INET, SOCK_STREAM case, listening sockets are effectively just endpoints for servicing SYNs - all userland I/O happens through connected sockets derived from such listening sockets). It is also possible that the fix we applied for the accept1() case is incomplete; it's also possible that we should in fact have applied it here. If you could remind me of the URL of that dotfile you graphed with the socket layer call graph, that would be most useful. ;-) There are however a bunch of bits which probably shouldn't be applied to the new socket, but as above, it looks like these shouldn't be in effect for the listening socket. Regards, BMS