From: Olaf Kirch <okir@suse.de>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX
Date: Mon, 23 Feb 2004 10:42:10 +0100 [thread overview]
Message-ID: <20040223094209.GA12663@suse.de> (raw)
In-Reply-To: <20040221130853.4c98bad6.davem@redhat.com>
On Sat, Feb 21, 2004 at 01:08:53PM -0800, David S. Miller wrote:
> Well, first things first, using blocking sockets with select/poll is kind
> of stupid programming.
But that's the way many real world applications do it, including
for instance the glibc sunrpc code.
> I think we should fix it like the following, which is basically the last
> part of Olaf's original patch in this thread. Just wait for another packet
> if a blocking socket and checksum fails, else if non-blocking -EAGAIN is OK.
But that breaks poll/recvmsg on a blocking socket, because poll with
assert POLLIN, but the recvmsg call with block.
I agree that plucking packets off the queue inside poll() is ugly.
The alternative would be to just walk the queue to see if there is at
least one packet with valid checksum, and clear POLLIN if there isn't,
but otherwise leave the queue untouched. This would work in all except
the most extreme scenarios where your recv queue is filled to the limit
with bad packets, and any new packets with potentially good checksums
get dropped. This would make it easy to DoS any UDP based service
by spraying it with bad udp packets.
Olaf
--
Olaf Kirch | Stop wasting entropy - start using predictable
okir@suse.de | tempfile names today!
---------------+
next prev parent reply other threads:[~2004-02-23 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-17 12:17 [PATCH] 2.6 UDP recvmsg vs POSIX Olaf Kirch
2004-02-18 4:30 ` Andi Kleen
2004-02-18 6:17 ` David S. Miller
2004-02-19 7:07 ` Andi Kleen
2004-02-21 21:08 ` David S. Miller
2004-02-23 9:42 ` Olaf Kirch [this message]
2004-02-23 17:42 ` David S. Miller
2004-02-24 9:32 ` Olaf Kirch
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=20040223094209.GA12663@suse.de \
--to=okir@suse.de \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.com \
/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).