Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Oct 2007 22:34:29 +0100
From:      Matus Harvan <mharvan@inf.ethz.ch>
To:        "Bruce M. Simpson" <bms@FreeBSD.org>
Cc:        freebsd-net@freebsd.org, Brooks Davis <brooks@freebsd.org>, Max Laier <max@love2party.net>
Subject:   Re: TCP listenall
Message-ID:  <20071031213429.GB2086@styx.ethz.ch>
In-Reply-To: <4722B6A3.6030606@FreeBSD.org>
References:  <20070909204148.GB18107@inf.ethz.ch> <20071026155206.GH1049@styx.ethz.ch> <4722B6A3.6030606@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--RASg3xLB4tUQ4RcS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Oct 27, 2007 at 04:55:15AM +0100, Bruce M. Simpson wrote:
> 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.
>>  =20
>=20
> I have mixed feelings about this patch.
>=20
> The idea of a TCP socket which magically loses its TCP semantics is=20
> unattractive -- SOCK_RAW is traditionally where we've put things which=20
> don't fit the rest of the BSD socket API -- however in this case I don't=
=20
> see we have much choice, if what we desire is the ability for a client to=
=20
> establish a connection to any ephemeral port with the mtund returning fro=
m=20
> an accept() as usual.
>=20
> We are bending the rules of the usual TCP semantics here, but that is OK=
=20
> because if we directed tlistenall to be a raw IP socket, we'd need a way =
to=20
> say to TCP, 'I'd like to create a socket which is already in SYN_RCVD sta=
te=20
> with a SYN whose mbuf has now gone to lunch', assuming we wish to create=
=20
> TCP streams business as usual.

Exactly.

[...]
> How will inp_tlistenall appear in netstat output? Perhaps assigning a=20
> LISTEN_ALL state would be helpful for an administrator to clearly see tha=
t=20
> a listenall socket is active? Perhaps checking for TCP_LISTENALL set on a=
n=20
> unbound socket in tcp_usr_listen() when listen() is called is the way to =
go=20
> instead of, or in addition to, using inp_tlistenall?

I think there can be only one LISTEN_ALL socket. Hence, inp_tlistenall
should be ok. Furthermore, having inp_tlistenall allows me to
immediately know which is the listenall socket without having to
search through all the sockets.

Currently, the user has to setsockopt() TCP_LISTENALL on the socket
after calling listen(). One disadvanatage is that the user has to
select a port when calling listen(). However, it minimizes the changes
needed to get the listenall funcitonality. Are you suggesting that the
setsockopt() could be called first and the listen() would follow?

With the state for netstat, wouldn't this require adding the
LISTEN_ALL state to the TCPS_* states in sys/netinet/tcp_fsm.h:45? If
yes, then this might require more modifications.

Matus

--RASg3xLB4tUQ4RcS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFHKPTl43LQWDWf0QIRAuM6AJ9F1EaBkh437dTv/uZtjNwogesUZQCeMUKu
WG1Q9L5fM28gRqUfY4htAjY=
=Abww
-----END PGP SIGNATURE-----

--RASg3xLB4tUQ4RcS--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071031213429.GB2086>