Subject: Obtaining client IP address before accept(2)
To: None <tech-kern@netbsd.org>
From: Matthew Mondor <mm_lists@pulsar-zone.net>
List: tech-kern
Date: 07/12/2005 18:16:11
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.
I noticed that this feature is usually implemented differently on
various unix operating systems. I verified if getsockopt(2) supported
an SO_GETADDR but it doesn't. I am wondering if MSG_PEEK, or SCM_CREDS,
could provide a way to do this through ancillary data with recvmsg(2)? I
haven't looked at the code yet, thought I would ask first if anyone
knows...
Also, if MSG_PEEK worked, how would I unqueue the event instead of
calling accept(2) if needed?
Thanks,
Matt
--
Note: Please only reply on the list since other mail is blocked by default.
Private messages from your address can be allowed by first asking, however.