From owner-cvs-all@FreeBSD.ORG Sat Mar 27 18:55:22 2004 Return-Path: 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 3C0F116A4D0; Sat, 27 Mar 2004 18:55:22 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBF7E43D41; Sat, 27 Mar 2004 18:55:21 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i2S2qwxC014988; Sat, 27 Mar 2004 21:52:58 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i2S2qwcx014985; Sat, 27 Mar 2004 21:52:58 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Sat, 27 Mar 2004 21:52:57 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Julian Elischer In-Reply-To: <4066159C.7030102@elischer.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Pawel Jakub Dawidek cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet in_pcb.c in_pcb.h ip_divert.c tcp_syncache.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6 in6_pcb.c in6_pcb.h in6_src.c udp6_output.c udp6_usrreq.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 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: Sun, 28 Mar 2004 02:55:22 -0000 On Sat, 27 Mar 2004, Julian Elischer wrote: > Pawel Jakub Dawidek wrote: > > > Log: > > Reduce 'td' argument to 'cred' (struct ucred) argument in those functions: > > - in_pcbbind(), > > - in_pcbbind_setup(), > > - in_pcbconnect(), > > - in_pcbconnect_setup(), > > - in6_pcbbind(), > > - in6_pcbconnect(), > > - in6_pcbsetport(). > > "It should simplify/clarify things a great deal." --rwatson > > do any of these store the cred pointer? Creds need to be strictly > refcounted. The credential is only used during the functions, and the reference is owned by the calling thread for the duration of the calls. This change basically moves the td->td_ucred dereference to the caller, rather than doing them in the function. It should be no less safe than the existing code, and since td_ucred is a thread-local reference, it should be safe assuming curthread==td in the caller. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research