Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Feb 1998 12:49:20 -0800
From:      Paul Traina <pst@Shockwave.COM>
To:        undisclosed-recipients:;
Subject:   getting remote side of tcp connection's address before accept()?
Message-ID:  <199802202049.MAA06914@precipice.shockwave.com>

index | next in thread | raw e-mail

------- Blind-Carbon-Copy

To: questions@freebsd.org
Subject: getting remote side of tcp connection's address before accept()?
Date: Fri, 20 Feb 1998 12:49:20 -0800
From: Paul Traina <pst@precipice.shockwave.com>

Folks,

I'd like to be able to refuse tcp connections to a particular daemon
from a certain list of addresses.

What I'd ideally like to do is bind and listen on a socket, then
when a connection request comes in, check the remote peer's address
information, and allow the connection only if the address info
was correct.

If I do it with a standard:

		bind
		listen
		accept
		if (!good_address)
			close
			
The tcp connection is accepted and then closed.  I want the TCP
connection to be refused, never accepted.

Under ISO/TP4, the accept(2) and recvmsg(2) manual pages inply you
can pull this off by closing the accept'ed socket before ever doing
any real read/write operations to it.

Has anyone ever pulled this off with tcp sockets?

------- End of Blind-Carbon-Copy

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message


home | help

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