svn commit: r183689 - head/sys/kern
Robert Watson
rwatson at FreeBSD.org
Wed Oct 8 06:19:49 UTC 2008
Author: rwatson
Date: Wed Oct 8 06:19:49 2008
New Revision: 183689
URL: http://svn.freebsd.org/changeset/base/183689
Log:
Differentiate pr_usrreqs for stream and datagram UNIX domain sockets, and
employ soreceive_dgram for the datagram case.
MFC after: 3 months
Modified:
head/sys/kern/uipc_usrreq.c
Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c Wed Oct 8 05:30:30 2008 (r183688)
+++ head/sys/kern/uipc_usrreq.c Wed Oct 8 06:19:49 2008 (r183689)
@@ -249,20 +249,20 @@ static struct mbuf *unp_addsockcred(stru
* Definitions of protocols supported in the LOCAL domain.
*/
static struct domain localdomain;
-static struct pr_usrreqs uipc_usrreqs;
+static struct pr_usrreqs uipc_usrreqs_dgram, uipc_usrreqs_stream;
static struct protosw localsw[] = {
{
.pr_type = SOCK_STREAM,
.pr_domain = &localdomain,
.pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
.pr_ctloutput = &uipc_ctloutput,
- .pr_usrreqs = &uipc_usrreqs
+ .pr_usrreqs = &uipc_usrreqs_stream
},
{
.pr_type = SOCK_DGRAM,
.pr_domain = &localdomain,
.pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS,
- .pr_usrreqs = &uipc_usrreqs
+ .pr_usrreqs = &uipc_usrreqs_dgram
},
};
@@ -996,7 +996,7 @@ uipc_sockaddr(struct socket *so, struct
return (0);
}
-static struct pr_usrreqs uipc_usrreqs = {
+static struct pr_usrreqs uipc_usrreqs_dgram = {
.pru_abort = uipc_abort,
.pru_accept = uipc_accept,
.pru_attach = uipc_attach,
@@ -1012,6 +1012,27 @@ static struct pr_usrreqs uipc_usrreqs =
.pru_sense = uipc_sense,
.pru_shutdown = uipc_shutdown,
.pru_sockaddr = uipc_sockaddr,
+ .pru_soreceive = soreceive_dgram,
+ .pru_close = uipc_close,
+};
+
+static struct pr_usrreqs uipc_usrreqs_stream = {
+ .pru_abort = uipc_abort,
+ .pru_accept = uipc_accept,
+ .pru_attach = uipc_attach,
+ .pru_bind = uipc_bind,
+ .pru_connect = uipc_connect,
+ .pru_connect2 = uipc_connect2,
+ .pru_detach = uipc_detach,
+ .pru_disconnect = uipc_disconnect,
+ .pru_listen = uipc_listen,
+ .pru_peeraddr = uipc_peeraddr,
+ .pru_rcvd = uipc_rcvd,
+ .pru_send = uipc_send,
+ .pru_sense = uipc_sense,
+ .pru_shutdown = uipc_shutdown,
+ .pru_sockaddr = uipc_sockaddr,
+ .pru_soreceive = soreceive_generic,
.pru_close = uipc_close,
};
More information about the svn-src-all
mailing list