From owner-freebsd-net Wed Oct 2 11:27:23 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A45A337B401 for ; Wed, 2 Oct 2002 11:27:22 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47E0843E3B for ; Wed, 2 Oct 2002 11:27:20 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.4/8.12.4) with SMTP id g92IQoOo049024 for ; Wed, 2 Oct 2002 14:26:50 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Wed, 2 Oct 2002 14:26:49 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: net@FreeBSD.org Subject: NFS client code calls sosend() directly... Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I was groping around through the socket code today looking for more places to sprinkle mandatory access control magic, and noticed that in most parts of the system call and protocol-independent socket implementation, sosend() is never invoked directly: instead, pru_sosend() is invoked, and protocols have the option of implementing pru_sosend() using the central sosend(), or providing their own optimized implementation. However, the exception to this appears to be in the nfsclient code, where sosend is invoked directly on the socket: bootp_subr.c- bootp_subr.c: error = sosend(so, (struct sockaddr *) &dst, bootp_subr.c- &auio, NULL, NULL, 0, td); bootp_subr.c- if (error != 0) { ... krpc_subr.c- } krpc_subr.c: error = sosend(so, (struct sockaddr *)sa, NULL, m, krpc_subr.c- NULL, 0, td); krpc_subr.c- if (error) { It strikes me that instead it should be calling: error = so->so_proto->pr_usrreqs->pru_sosend(...) So that protocols can implement sosend as they see fit. The NFS server code appears to do this fine. Is this interpretation correct? Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message