summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1997-11-09 05:07:40 +0000
committerjkh <jkh@FreeBSD.org>1997-11-09 05:07:40 +0000
commitb820ab98456bfa33c0920604b7f8d49bc85785f9 (patch)
tree5a88fb1c30896a2e9aca5a3d45952cc56d4e8640 /sys/kern/uipc_socket.c
parent555986da720ae38415117723b464c86c714d8193 (diff)
downloadFreeBSD-src-b820ab98456bfa33c0920604b7f8d49bc85785f9.zip
FreeBSD-src-b820ab98456bfa33c0920604b7f8d49bc85785f9.tar.gz
MF22: MSG_EOR bug fix.
Submitted by: wollman
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 3aa73ed..b418677 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id: uipc_socket.c,v 1.32 1997/10/04 18:21:15 phk Exp $
+ * $Id: uipc_socket.c,v 1.33 1997/10/12 20:24:12 phk Exp $
*/
#include <sys/param.h>
@@ -358,9 +358,15 @@ sosend(so, addr, uio, top, control, flags, p)
* 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.
+ *
+ * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
+ * type sockets since that's an error.
*/
- if (resid < 0)
- return (EINVAL);
+ if (resid < 0 || so->so_type == SOCK_STREAM && (flags & MSG_EOR)) {
+ error = EINVAL;
+ goto out;
+ }
+
dontroute =
(flags & MSG_DONTROUTE) && (so->so_options & SO_DONTROUTE) == 0 &&
(so->so_proto->pr_flags & PR_ATOMIC);
OpenPOWER on IntegriCloud