Re: UDP recvmsg blocks after select(), 2.6 bug?

From: Chris Friesen
Date: Thu Oct 07 2004 - 18:01:37 EST


David S. Miller wrote:
Chris Friesen <cfriesen@xxxxxxxxxxxxxxxxxx> wrote:

What I had in mind was that the non-blocking file descriptor have select() return without verifying the checksum, and if it was discovered to be bad at recvmsg() time, we return EAGAIN.


That's what we do. In net/ipv4/udp.c:udp_recvmsg()

Yes. I realize this, and agree with that behaviour.

However, you chopped off what I consider the interesting part of my post. I propose that if we call select() on a blocking file descriptor, we verify the checksum before saying that the socket is readable. Then, at recvmsg() time, if it hasn't been checked already we would check it (to allow for the case of blocking socket without select()).

This allows for easy porting of apps that expect a blocking recvmsg() after select() to always succeed.

Thus, you end up with:

nonblocking socket -- exactly as current
blocking socket without select -- exactly as current
blocking socket with select -- checksum verified before select() returns


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