Subject: Re: Obtaining client IP address before accept(2)
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 07/13/2005 17:12:01
>> Except that that means the connection comes up, in the TCP sense,
>> which as I read it is what Matt was trying to avoid.
> However, the userland routines give you a conenction that has already
> been ack'd.

Yes.  That's what needs to change for this to happen.

Back when I worked with DECnet under Ultrix, they had a socket option
you could set that gave you (their analog of) a connection in SYN_RCVD
upon accept(); then you had to do one of two other calls (I forget
details) to either abort it or have it carry through with the
handshake.

>> It can?  When I do that, I see a FIN segment, not an RST.
> Shouldn't you only get a FIN when you shutdown() the socket before
> you close() it?

That's not the traditional behaviour and it's not what I see in my
tests.  Whether it's how it should be is debatable; I suspect that
changing it would break enough code it's a non-starter in practice.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B