netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: anton@samba.org
Cc: acme@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net: recvmmsg: Strip MSG_WAITFORONE when calling recvmsg
Date: Tue, 17 May 2011 15:38:28 -0400 (EDT)	[thread overview]
Message-ID: <20110517.153828.1804367055800380672.davem@davemloft.net> (raw)
In-Reply-To: <20110517085924.3a47b8e2@kryten>

From: Anton Blanchard <anton@samba.org>
Date: Tue, 17 May 2011 08:59:24 +1000

> 
> 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>
> Cc: stable@kernel.org [2.6.34+]
> ---
> 
> We could also add MSG_WAITFORONE to the raw socket recvmsg check, or
> just remove the check completely. Thoughts?

I think both should be done.

Tests like the one packet_recvmsg() is doing makes it really hard to
add new MSG_* flags generically (ie. by adding the flag and having
some generic socket operation all recvmsg() implementations call
process that flag bit in some way).

It should just explicitly check for the bits it doesn't support.

And recvmmsg() should clear the bit because it is a completely
internal thing.  It's similar to how we hide MSG_CMSG_COMPAT from
userspace.

Anyways I'll apply this patch, and feel free to submit the other
one.

Thanks.

      reply	other threads:[~2011-05-17 19:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 22:59 [PATCH] net: recvmmsg: Strip MSG_WAITFORONE when calling recvmsg Anton Blanchard
2011-05-17 19:38 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110517.153828.1804367055800380672.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=acme@redhat.com \
    --cc=anton@samba.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).