Subject: Re: kern/29750: send/sendto/sendmsg don't block when no buffer space is available
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Jason Thorpe <thorpej@shagadelic.org>
List: netbsd-bugs
Date: 03/22/2005 23:43:01
The following reply was made to PR kern/29750; it has been noted by GNATS.

From: Jason Thorpe <thorpej@shagadelic.org>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/29750: send/sendto/sendmsg don't block when no buffer space is available
Date: Tue, 22 Mar 2005 15:42:19 -0800

 On Mar 22, 2005, at 3:34 PM, Emmanuel Dreyfus wrote:
 
 >  If there is buffer space, sosend() calls lower layer output  
 > functions.
 >  Here udp_output(), then ip_output(), and ether_output().
 
 By this time, the data is properly enqueued in the socket buffer, right?
 
 >  ether_output() uses IFQ_ENQUEUE() to queue the packet. That macro  
 > checks
 >  that the queue is not full through IF_QFULL(), and return ENOBUFS  
 > if the
 >  interface queue is full. This is what happens here.
 >
 >  ENOBUFS is returned up to send() and causes the problem.
 
 Yuck.  Arguably, what should happen is that this ENOBUFS should get  
 translated to 0 (no error) in sosend().  However, we still need some  
 way to kick the socket into calling udp_output() again once ifqueue  
 space becomes available.
 
 Or we could just say "screw it!" and get rid of ifqeueue max lengths  
 all together.
 
 -- thorpej