diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-02-20 10:50:02 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-02-20 10:50:02 +0000 |
commit | 6d90d77c6f1443f51d62e743e3602792500d9d57 (patch) | |
tree | b536d57ca72eb9e769969c0e00940d1f599b8670 /sys/kern | |
parent | 4904133d3c2ca3e4f5e45f2ff2e29b25977b125f (diff) | |
download | FreeBSD-src-6d90d77c6f1443f51d62e743e3602792500d9d57.zip FreeBSD-src-6d90d77c6f1443f51d62e743e3602792500d9d57.tar.gz |
Break introductory comment into two paragraphs to separate material on the
garbage collection complications from general discussion of UNIX domain
sockets.
Staticize unp_addsockcred().
Remove XXX comment regarding Giant and v_socket -- v_socket is protected
by the global UNIX domain socket lock.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 00dd054..64fe699 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -41,12 +41,13 @@ * connected in pairs (socketpair(2)), or bound/connected to using the file * system name space. For most purposes, only the receive socket buffer is * used, as sending on one socket delivers directly to the receive socket - * buffer of a second socket. The implementation is substantially - * complicated by the fact that "ancillary data", such as file descriptors or - * credentials, may be passed across UNIX domain sockets. The potential for - * passing UNIX domain sockets over other UNIX domain sockets requires the - * implementation of a simple garbage collector to find and tear down cycles - * of disconnected sockets. + * buffer of a second socket. + * + * The implementation is substantially complicated by the fact that + * "ancillary data", such as file descriptors or credentials, may be passed + * across UNIX domain sockets. The potential for passing UNIX domain sockets + * over other UNIX domain sockets requires the implementation of a simple + * garbage collector to find and tear down cycles of disconnected sockets. * * TODO: * SEQPACKET, RDM @@ -184,7 +185,7 @@ static void unp_freerights(struct file **, int); static int unp_internalize(struct mbuf **, struct thread *); static int unp_listen(struct socket *, struct unpcb *, int, struct thread *); -struct mbuf *unp_addsockcred(struct thread *, struct mbuf *); +static struct mbuf *unp_addsockcred(struct thread *, struct mbuf *); /* * Definitions of protocols supported in the LOCAL domain. @@ -461,10 +462,6 @@ uipc_detach(struct socket *so) unp->unp_gencnt = ++unp_gencnt; --unp_count; if ((vp = unp->unp_vnode) != NULL) { - /* - * XXXRW: should v_socket be frobbed only while holding - * Giant? - */ unp->unp_vnode->v_socket = NULL; unp->unp_vnode = NULL; } @@ -1557,7 +1554,7 @@ out: return (error); } -struct mbuf * +static struct mbuf * unp_addsockcred(struct thread *td, struct mbuf *control) { struct mbuf *m, *n, *n_prev; |