summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-11-11 18:22:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-11-11 18:22:50 +0000
commit69090decf3e42c7a755255d654ad20f66b7a62b9 (patch)
tree7c9942f35c802bbd788421c2683ee116c130b36f /sys/kern
parentf52556609b5c2490043f9ff34d3f561ee7ece407 (diff)
MSG_EOR on SOCK_STREAM is invalid; wollman
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_socket.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 528b81bb3e8..7e9f76191ad 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.17 1997/08/31 20:42:24 deraadt Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.18 1997/11/11 18:22:49 deraadt Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -354,8 +354,10 @@ sosend(so, addr, uio, top, control, flags)
* if we over-committed, and we must use a signed comparison
* of space and resid. On the other hand, a negative resid
* causes us to loop sending 0-length segments to the protocol.
+ * MSG_EOR on a SOCK_STREAM socket is also invalid.
*/
- if (resid < 0) {
+ if (resid < 0 ||
+ (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
error = EINVAL;
goto out;
}