patch-1.3.63 linux/net/socket.c
Next file: linux/net/unix/af_unix.c
Previous file: linux/net/ipv4/tcp_timer.c
Back to the patch index
Back to the overall index
- Lines: 29
- Date:
Tue Feb 13 16:57:06 1996
- Orig file:
v1.3.62/linux/net/socket.c
- Orig date:
Wed Dec 27 09:12:15 1995
diff -u --recursive --new-file v1.3.62/linux/net/socket.c linux/net/socket.c
@@ -1089,19 +1089,25 @@
if (!(sock = sockfd_lookup(fd, NULL)))
return(-ENOTSOCK);
+ if(sock->ops->sendmsg==NULL)
+ return -EOPNOTSUPP;
+
+
err=verify_area(VERIFY_READ, msg,sizeof(struct msghdr));
if(err)
return err;
+
memcpy_fromfs(&msg_sys,msg,sizeof(struct msghdr));
+
+ /* do not move before msg_sys is valid */
if(msg_sys.msg_iovlen>MAX_IOVEC)
return -EINVAL;
+
err=verify_iovec(&msg_sys,iov,address, VERIFY_READ);
if(err<0)
return err;
total_len=err;
-
- if(sock->ops->sendmsg==NULL)
- return -EOPNOTSUPP;
+
return sock->ops->sendmsg(sock, &msg_sys, total_len, (file->f_flags&O_NONBLOCK), flags);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this