From: Chris Friesen <cfriesen@nortelnetworks.com>
To: root@chaos.analogic.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: want opinions on possible glitch in 2.4 network error reporting
Date: Wed, 06 Feb 2002 17:23:23 -0500 [thread overview]
Message-ID: <3C61ACDB.6759302F@nortelnetworks.com> (raw)
In-Reply-To: <Pine.LNX.3.95.1020206154220.29419A-100000@chaos.analogic.com>
"Richard B. Johnson" wrote:
[snip]
> Hackers code sendto as:
> sendto(s,...);
> Professional programmers use:
> (void)sendto(s,...);
>
> checking the return value is useless.
>
> Note that the man-page specifically states that ENOBUFS can't happen.
I don't know what your manpage says, but my manpage doesn't say anything about
ENOBUFS not being possible. From the man page:
"ENOBUFS The system was unable to allocate an internal memory block. The
operation may succeed when buffers become available."
> You cannot assume that any sendto() data actually gets on the wire, much
> less to its destination. With any user-datagram-protocol, both ends,
> sender and receiver, have to work out what they will do with missing
> packets and packets received out-of-order.
Hmm. I knew you couldn't assume it was delivered (the man page says so), but I
didn't know it doesn't guarantee it getting to the wire. The man page says that
"locally detected errors are indicated by a return value of -1". Furthermore,
it also says "When the message does not fit into the send buffer of the socket,
send normally blocks, unless the socket has been placed in non-blocking I/O
mode."
I would suggest that if the packet doesn't make it onto the wire, sendto()
should either a) block until it can send the packet (or return with EAGAIN, as
appropriate), or b) return an error.
Chris
--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com
next prev parent reply other threads:[~2002-02-06 22:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-06 20:31 want opinions on possible glitch in 2.4 network error reporting Chris Friesen
2002-02-06 20:56 ` Richard B. Johnson
2002-02-06 21:45 ` Ben Greear
2002-02-06 22:23 ` Chris Friesen [this message]
2002-02-07 13:44 ` Richard B. Johnson
2002-02-07 16:33 ` Gerold Jury
2002-02-07 0:24 ` Alan Cox
2002-02-07 0:26 ` Alan Cox
2002-02-07 1:51 ` Ion Badulescu
2002-02-07 2:08 ` Alan Cox
2002-02-07 2:09 ` Ion Badulescu
2002-02-07 2:34 ` Alan Cox
2002-02-07 2:54 ` Ion Badulescu
2002-02-07 11:11 ` Alan Cox
2002-02-08 16:11 ` Pavel Machek
2002-02-08 21:39 ` Ion Badulescu
2002-02-07 4:21 ` Ben Greear
2002-02-07 4:38 ` David S. Miller
2002-02-07 4:56 ` Ben Greear
2002-02-07 4:23 ` Ben Greear
2002-02-07 4:37 ` Ion Badulescu
2002-02-07 9:22 ` Luis Garces
[not found] <3C6192A5.911D5B4F@nortelnetworks.com.suse.lists.linux.kernel>
2002-02-07 0:06 ` Andi Kleen
2002-02-07 15:59 ` Chris Friesen
2002-02-07 16:01 ` Andi Kleen
[not found] <E16Ydys-0007D6-00@the-village.bc.nu.suse.lists.linux.kernel>
[not found] ` <Pine.LNX.4.44.0202062101390.4832-100000@age.cs.columbia.edu.suse.lists.linux.kernel>
2002-02-07 2:47 ` Andi Kleen
2002-02-07 6:25 ` Chris Friesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C61ACDB.6759302F@nortelnetworks.com \
--to=cfriesen@nortelnetworks.com \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox