From owner-freebsd-questions Fri Feb 20 12:51:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA00544 for freebsd-questions-outgoing; Fri, 20 Feb 1998 12:51:35 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from precipice.shockwave.com (precipice.shockwave.com [207.105.15.229]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA29995 for ; Fri, 20 Feb 1998 12:50:41 -0800 (PST) (envelope-from pst@Shockwave.COM) Received: from precipice.shockwave.com (localhost [127.0.0.1]) by precipice.shockwave.com (8.8.8/8.8.8) with ESMTP id MAA06911 for ; Fri, 20 Feb 1998 12:49:52 -0800 (PST) (envelope-from pst@precipice.shockwave.com) Message-Id: <199802202049.MAA06911@precipice.shockwave.com> 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 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message