Subject: Re: Obtaining client IP address before accept(2)
To: Matthew Mondor <mm_lists@pulsar-zone.net>
From: Tonnerre <tonnerre@thundrix.ch>
List: tech-kern
Date: 07/13/2005 10:54:39
--n8g4imXOkfNTN/H1
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline

Salut,

On Tue, Jul 12, 2005 at 06:16:11PM -0400, Matthew Mondor wrote:
> It would be most useful for some of my applications to be able to know
> the IP address of a client before calling accept(2), and to be able to
> cancel that connection event without needing to accept(2) and close(2)
> it.

Since you usually get clientfds in an accept() loop, close()ing the
connection would be the natural way of doing things. If you want to
NAK the connection from the beginning, you should do it in the firewall.
However, this is unnatural behavior, normally you just RST a connection,
which can be done by close().

				Tonnerre

--n8g4imXOkfNTN/H1
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFC1NbPXUVlAbfmNMIRArF5AJ9iMkZnIoSvKowGMwNWOjgrSeug0wCg3BlH
1XhYYy8r5HPU6VM4zWAC3fQ=
=v3XP
-----END PGP SIGNATURE-----

--n8g4imXOkfNTN/H1--