Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Oct 2002 14:26:49 -0400 (EDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        net@FreeBSD.org
Subject:   NFS client code calls sosend() directly...
Message-ID:  <Pine.NEB.3.96L.1021002142420.46964I-100000@fledge.watson.org>

next in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1021002142420.46964I-100000>