lkml.org 
[lkml]   [2004]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: UDP recvmsg blocks after select(), 2.6 bug?
Date
> Hua Zhong wrote:
>
> > How hard is it to treat the next read to the fd as
> NON_BLOCKING, even if
> > it's not set?
>
> Userspace likely would not properly handle EAGAIN on a
> nonblocking socket.

But it's better than blocking the call, isn't it?

If the caller is using NON_BLOCKING already, no change in behavior,
otherwise it returns an error which the app may or may not handle, instead
of blocking it (which is usually fatal). Plus it hopefully gives Posix
compliance.

I can see there could be remote DoS attacks by just sending malformed UDP
packets.

> As far as I can tell, either you block, or you have to scan
> the checksum before
> select() returns.
>
> Would it be so bad to do the checksum before marking the
> socket readable?
> Chances are we're going to receive the message "soon"
> anyways, so there is at
> least a chance it will stay hot in the cache, no?
>
> Chris
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site