From owner-freebsd-net@FreeBSD.ORG Sat Oct 27 03:55:18 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3592E16A41A; Sat, 27 Oct 2007 03:55:18 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id ED6A713C4A5; Sat, 27 Oct 2007 03:55:17 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 233173ED78; Fri, 26 Oct 2007 23:55:17 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 26 Oct 2007 23:55:17 -0400 X-Sasl-enc: 1THK6rM5rp/qQyU1rRtyIQeP22Rel0FZPSAgTZTV2kiw 1193457316 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id 747371B80F; Fri, 26 Oct 2007 23:55:16 -0400 (EDT) Message-ID: <4722B6A3.6030606@FreeBSD.org> Date: Sat, 27 Oct 2007 04:55:15 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.6 (X11/20070928) MIME-Version: 1.0 To: Matus Harvan References: <20070909204148.GB18107@inf.ethz.ch> <20071026155206.GH1049@styx.ethz.ch> In-Reply-To: <20071026155206.GH1049@styx.ethz.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, Brooks Davis , Max Laier Subject: Re: TCP listenall X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2007 03:55:18 -0000 Matus Harvan wrote: > Hi, > > I was wondering if I could get some feedback about the patch and > whether others think it could be committed. A slightly update version > of the patch is at the end of this email. > I have mixed feelings about this patch. The idea of a TCP socket which magically loses its TCP semantics is unattractive -- SOCK_RAW is traditionally where we've put things which don't fit the rest of the BSD socket API -- however in this case I don't see we have much choice, if what we desire is the ability for a client to establish a connection to any ephemeral port with the mtund returning from an accept() as usual. We are bending the rules of the usual TCP semantics here, but that is OK because if we directed tlistenall to be a raw IP socket, we'd need a way to say to TCP, 'I'd like to create a socket which is already in SYN_RCVD state with a SYN whose mbuf has now gone to lunch', assuming we wish to create TCP streams business as usual. The relay port idea I pointed out in my message about udp catchall would be especially applicable here -- we may not always want catchalls for the entire 16-bit tcp port space. listenallr is static and is going to get trashed by concurrent threads, unless there is a serialization with a lock, which I don't see. How will inp_tlistenall appear in netstat output? Perhaps assigning a LISTEN_ALL state would be helpful for an administrator to clearly see that a listenall socket is active? Perhaps checking for TCP_LISTENALL set on an unbound socket in tcp_usr_listen() when listen() is called is the way to go instead of, or in addition to, using inp_tlistenall? Again, good work, but needs more polish before it can go into mainline (IMHO). best, BMS