From owner-freebsd-current@FreeBSD.ORG Sun May 21 18:04:59 2006 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C68F16A759 for ; Sun, 21 May 2006 18:04:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61F0243D66 for ; Sun, 21 May 2006 18:04:58 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 90D8946CCB; Sun, 21 May 2006 14:04:57 -0400 (EDT) Date: Sun, 21 May 2006 19:04:57 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Maxim Konovalov In-Reply-To: <20060521215823.H6324@mp2.macomnet.net> Message-ID: <20060521190358.G8068@fledge.watson.org> References: <20060317141627.W2181@fledge.watson.org> <20060329100839.V19236@fledge.watson.org> <20060401102918.P79188@fledge.watson.org> <20060401170554.R82503@fledge.watson.org> <20060402233436.P76562@fledge.watson.org> <20060515025600.U70399@mp2.macomnet.net> <20060521185034.K8068@fledge.watson.org> <20060521215823.H6324@mp2.macomnet.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: current@FreeBSD.org Subject: Re: HEADS UP: socket and pcb reference changes entering tree today X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 May 2006 18:05:04 -0000 On Sun, 21 May 2006, Maxim Konovalov wrote: >> This looks good in terms of pcb structure, but you should acquire SOCK_LOCK >> around the so_state manipulation. To prevent races, I suggest doing it >> while also holding the INP lock in the center of the locking sets from the >> inpcb. There are some other remaining bugs in the raw socket code elsewhere >> also, I think. > > I "copied" this code from udp_usrreq.c::udp_disconnect(). There is no such > lock. Is it a bug too? Yes. I have some intuitions about why the datagram protocols manually frob the disconnected flag rather than calling soisdisconnected(), but am generally unsure that this is the right thing. Robert N M Watson