From owner-freebsd-hackers Thu Dec 14 9:12:26 2000 From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 14 09:12:24 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from karon.dynas.se (karon.dynas.se [192.71.43.4]) by hub.freebsd.org (Postfix) with SMTP id 30AD237B402 for ; Thu, 14 Dec 2000 09:12:23 -0800 (PST) Received: (qmail 4434 invoked from network); 14 Dec 2000 17:12:21 -0000 Received: from spirit.sto.dynas.se (HELO spirit.dynas.se) (172.16.1.10) by karon.sto.dynas.se with SMTP; 14 Dec 2000 17:12:21 -0000 Received: (qmail 27003 invoked by uid 1125); 14 Dec 2000 17:12:25 -0000 Date: Thu, 14 Dec 2000 09:12:18 -0800 (PST) From: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= X-Sender: mikko@dynas.se To: freebsd-hackers@freebsd.org Subject: Rejecting a connection: is accept(2) correct? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Reply-To: mikko@dynas.se X-MIME-Autoconverted: to 8bit by snemail 0.35 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG AFAIK there is no portable way to reject incoming connections without calling accept(). However, accept(2) states: One can obtain user connection request data without confirming the connection by issuing a recvmsg(2) call with an msg_iovlen of 0 and a non-zero msg_controllen, or by issuing a getsockopt(2) request. Similarly, one can provide user connection rejection information by issuing a sendmsg(2) call providing only the control information, or by calling setsockopt(2). Is this really true? A quick experiment with recvmsg() seems to indicate it is not, at least not for TCP sockets. ? /Mikko P.S. Anybody who claims that this works is encouraged to provide proof in the form of code... :-) Mikko Työläjärvi_______________________________________mikko@rsasecurity.com RSA Security To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message