From owner-freebsd-arch Sun Dec 30 19:22:59 2001 Delivered-To: freebsd-arch@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 4A26937B41E for ; Sun, 30 Dec 2001 19:22:53 -0800 (PST) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.6/8.11.5) with SMTP id fBV3MnD00626; Sun, 30 Dec 2001 22:22:49 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Sun, 30 Dec 2001 22:22:49 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Terry Lambert Cc: arch@FreeBSD.org Subject: Re: adding cred argument to socreate(), making NFS connect using , mount-time credential In-Reply-To: <3C2FD293.DA31AC4D@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 30 Dec 2001, Terry Lambert wrote: > Robert Watson wrote: > > > > Attached please find a diff that does the following: > > > > (1) Makes the credential used by socreate() an explicit argument to > > socreate(), rather than getting it implicitly from the thread > > argument. > > This prevents you from running connections to completion at interrupt, > in that it assumes that all calls will be down. > > The correct way to handle this in the "accept at interrupt" case is to > simply clone the credential off the listen socket, instead. Actually, socreate() does not appear to be used for the receiving end of the socket code: sonewconn() directly clones features of the listen socket into the accept socket. socreate() appears only to be used in the "outgoing" (down) direction. The only conceptual exception is socketpair(), but since the process gets both ends... This patch won't run into the problem, however. In fact, just a few weejs ago, I fixed the socket code to do precisely what you say: previously, it selected the credential based on one of thread (if available) and listen socket. This inconsistency caused great suffering, so I changed it to consistently clone the listen socket credential, for the reason you describe. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message