From owner-cvs-all@FreeBSD.ORG Fri Sep 16 06:57:29 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16F3E16A41F; Fri, 16 Sep 2005 06:57:29 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A21143D46; Fri, 16 Sep 2005 06:57:28 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id j8G6vPu3073036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Sep 2005 10:57:25 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id j8G6vPBF073035; Fri, 16 Sep 2005 10:57:25 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 16 Sep 2005 10:57:24 +0400 From: Gleb Smirnoff To: Maxim Konovalov Message-ID: <20050916065724.GI53891@cell.sick.ru> References: <200509151145.j8FBjbAU070614@repoman.freebsd.org> <20050915130901.R75005@fledge.watson.org> <20050915165142.F20393@mp2.macomnet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20050915165142.F20393@mp2.macomnet.net> User-Agent: Mutt/1.5.6i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson , cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2005 06:57:29 -0000 On Thu, Sep 15, 2005 at 05:14:04PM +0400, Maxim Konovalov wrote: M> > Are you sure this is the right thing to do? I've seen shutdown used M> > in several applications on non-connection-oriented sockets in order M> > to indicate no messages will be received, so not to allow received M> > packets to consume space. Typical use is in the context of a raw IP M> > or IPv6 socket, where raw packets will be sent but never received, M> > and the socket will otherwise collect the normal random network M> > detrious. M> > M> > For example, rtsold(8) uses shutdown(2) on its IPv6 raw socket to M> > indicate it is send-only, so received packets should not be stored M> > in the socket buffer since they will never be read. It does, M> > however, contain the not unusual bug that it is called with an M> > argument of 0, assuming that that will be the value SHUT_RD. I'm M> > fairly sure we used to have other examples of shutdown(2) being used M> > in this way in the tree but don't see any others in a casual glance. M> > M> > While POSIX mentions behavior for full-duplex connections, it does M> > not specify for sockets that are not connection-oriented, so as I M> > read it, the behavior we provide is permitted. M> M> Linux 2.4.21 return ENOTSUP for SOCK_RAW and ENOTCONN for M> non-connected SOCK_DGRAM. Solaris 9 returns ENOTCONN for M> non-connected SOCK_RAW and they don't allow shutdown(2) on M> non-connected sockets. Anyhow, I'll backout this code. I see you have already backed out :( What about return code back with check that socket belongs to PR_CONNREQUIRED protocol? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE