net: recvmmsg: Strip MSG_WAITFORONE when calling recvmsg
authorAnton Blanchard <anton@samba.org>
Tue, 17 May 2011 19:38:57 +0000 (15:38 -0400)
committerSteve Conklin <sconklin@canonical.com>
Fri, 15 Jul 2011 17:20:46 +0000 (12:20 -0500)
commit435234656ca01ac6e0023cb5e7bcbebf4e54b17c
tree831613f57e1da98cbc4afae6d08090ae43c96908
parentdfbd05371d0b4d37b4dc9a0e2f3d1de55802594c
net: recvmmsg: Strip MSG_WAITFORONE when calling recvmsg

BugLink: http://bugs.launchpad.net/bugs/793702

commit b9eb8b8752804cecbacdb4d24b52e823cf07f107 upstream.

recvmmsg fails on a raw socket with EINVAL. The reason for this is
packet_recvmsg checks the incoming flags:

        err = -EINVAL;
        if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT|MSG_ERRQUEUE))
                goto out;

This patch strips out MSG_WAITFORONE when calling recvmmsg which
fixes the issue.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
net/socket.c