From owner-freebsd-net Wed Feb 7 10:32:32 2001 Delivered-To: freebsd-net@freebsd.org Received: from syncopation-03.iinet.net.au (syncopation-03.iinet.net.au [203.59.24.49]) by hub.freebsd.org (Postfix) with SMTP id 97DB637B4EC for ; Wed, 7 Feb 2001 10:32:11 -0800 (PST) Received: (qmail 20293 invoked by uid 666); 7 Feb 2001 18:39:41 -0000 Received: from reggae-22-100.nv.iinet.net.au (HELO elischer.org) (203.59.87.100) by mail.m.iinet.net.au with SMTP; 7 Feb 2001 18:39:41 -0000 Message-ID: <3A8194A6.6E01AC1D@elischer.org> Date: Wed, 07 Feb 2001 10:32:06 -0800 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: Luigi Rizzo Cc: net@freebsd.org Subject: Re: send problem on udp socket... References: <200102071714.f17HEDH75274@iguana.aciri.org> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Luigi Rizzo wrote: > > Hi, > > just occurred to me that there exists the following feature of > send/sendmsg and probably also write on UDP sockets, and it would > be worth documenting. > > When you attempt to send() to an udp socket, the socket buffer > (which has no function other than bounding the max message size > for UDP sockets) is just bypassed, and the low-level routine gets > called. The latter (typically ip_output() or ether_output()) can > return an ENOBUFS message if some queue fills up down there (typically > the interface queue), and the error message is passed up. > > Now, the send() manpage is technically correct as it only > mentions the socket buffer full as the reason for blocking, > but in my opinion the above is not _that_ obvious and it would > be worth documenting. > > As a matter of fact, i wonder if it would be a good idea to > try and improve this behaviour by letting sosend() do a tsleep() > on the device/subsystem reporting the failure, and have the > latter issue a wakeup when space frees again. The only thing > is, i believe this has some odd ramifications with handling > select/poll, and might break some software that does not > handle blocking send() on UDP sockets. this is not just UDP but any packet based protocol. ping(8)(1?) uses this fact when you do a ping -f. if it get's a ENOBUFS, it does a usleep and backs off a bit. don't change it as it's teh expected behaviour. (well, at least I expect it....) > > cheers > luigi > ----------------------------------+----------------------------------------- > Luigi RIZZO, luigi@iet.unipi.it . ACIRI/ICSI (on leave from Univ. di Pisa) > http://www.iet.unipi.it/~luigi/ . 1947 Center St, Berkeley CA 94704 > Phone: (510) 666 2927 > ----------------------------------+----------------------------------------- > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000-2001 ---> X_.---._/ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message