Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux...
[deliverable/linux.git] / net / compat.c
index e13f5256fd20011b6e28d8549397f5137fc925b5..e1a56ade803b09b48e047e24192a3649ed0348d5 100644 (file)
@@ -390,9 +390,6 @@ asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
        int err;
        struct socket *sock;
 
-       if (optlen < 0)
-               return -EINVAL;
-
        if ((sock = sockfd_lookup(fd, &err))!=NULL)
        {
                err = security_socket_setsockopt(sock,level,optname);
@@ -761,9 +758,13 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
 {
        int datagrams;
        struct timespec ktspec;
-       struct compat_timespec __user *utspec =
-                       (struct compat_timespec __user *)timeout;
+       struct compat_timespec __user *utspec;
+
+       if (timeout == NULL)
+               return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
+                                     flags | MSG_CMSG_COMPAT, NULL);
 
+       utspec = (struct compat_timespec __user *)timeout;
        if (get_user(ktspec.tv_sec, &utspec->tv_sec) ||
            get_user(ktspec.tv_nsec, &utspec->tv_nsec))
                return -EFAULT;
This page took 0.025015 seconds and 5 git commands to generate.