Date: Sat, 27 Oct 2007 04:55:15 +0100 From: "Bruce M. Simpson" <bms@FreeBSD.org> To: Matus Harvan <mharvan@inf.ethz.ch> Cc: freebsd-net@freebsd.org, Brooks Davis <brooks@freebsd.org>, Max Laier <max@love2party.net> Subject: Re: TCP listenall Message-ID: <4722B6A3.6030606@FreeBSD.org> In-Reply-To: <20071026155206.GH1049@styx.ethz.ch> References: <20070909204148.GB18107@inf.ethz.ch> <20071026155206.GH1049@styx.ethz.ch>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4722B6A3.6030606>