RE: raw sockets and blocking
From: Paul Jakma
Date: Thu Feb 19 2004 - 01:34:38 EST
On Wed, 18 Feb 2004, David Schwartz wrote:
> Then the kernel is broken. It must not block an operation
> indefinitely when that operation can complete without blocking.
Aha.
> It is, however, perfectly legal to say an operation can
> complete without blocking (say, through 'select' or 'poll') and
> later return EWOULDBLOCK. (So long as some operation could have
> completed, not necessarily the one you tried.)
Right. But that's fine, we can deal with that, if the error is
posted.
Problem is no error is posted when we sendmsg[1], yet the socket
thereafter stays write-blocked, with (sane) way for us to recover.
(until presumably link comes back, for what ever reason,
unfortunately the OSPF RFCs do not mandate for hosts to have robots
attached to do media maintenance :) ).
In short, for raw sockets at least, the kernel needs to either:
- post an error for writes to raw sockets if they will block
or
- if the network driver concerned is not ready to take the packet,
drop the packet right there. (upper layers (ie userspace, eg ospfd)
will follow their own procedures for dealing with packet loss/down
interfaces.)
> DS
1. Least, Hasso has not reported the relevant error message occuring.
regards,
--
Paul Jakma paul@xxxxxxxx paul@xxxxxxxxx Key ID: 64A2FF6A
warning: do not ever send email to spam@xxxxxxxxxx
Fortune:
Your own qualities will help prevent your advancement in the world.
-
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/