Subject: Re: fixing send(2) semantics (kern/29750)
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 03/26/2005 06:14:29
> The socket layer calls lower layers and the send request hits the
> link layer. For instance we do sosend() -> udp_output() ->
> ip_output() -> ether_output().
> At the link layer, IFQ_ENQUEUE() is used to put the packet onto the
> interface queue. If the interface is full, ENOBUFS is returned and
> sosend() fails instead of blocking.
If it really does go through udp_output, it's a UDP socket, and any
send failure really should just drop the packet rather than pushing the
error up. (UDP is not a reliable protocol.)
I'm not sure what POSIX would have to say about this. I find it hard
to imagine that it couldn't be finessed on the "as if" princple - make
it behave "as if" the packet were sent but dropped by the underlying
network.
> Opinions?
My opinion: if POSIX forbids silently dropping the packet in the UDP
case, it is nuts and should be ignored (in this respect).
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B