From: Steven Dake <sdake@redhat.com>
To: netdev@vger.kernel.org
Subject: bytes received from recvmsg doesn't match FIONREAD
Date: Thu, 11 Oct 2007 16:08:15 -0700 [thread overview]
Message-ID: <1192144096.4147.16.camel@balance> (raw)
I wanted to verify that the size of a multicast UDP message received
with recvmsg matches the size of the message the kernel thinks the
message is.
So I went about using the FIONREAD ioctl as follows:
res = ioctl (fd, FIONCREAD, &value);
assert (res != -1);
bytes_received = recvmsg (fd, &msg_recv, MSG_NOSIGNAL | MSG_DONTWAIT);
assert (bytes_received == value);
It appears the value and bytes_received do not match after many
thousands of runs with a UDP multicast protocol (www.openais.org).
(neither is -1)
Am I using this ioctl improperly? Shouldn't I expect that the full
datagram is returned by recvmsg no matter the state of the blocking or
nonblocking mode of the file descriptor?
pls copy me on responses - i am not onlist.
Regards
-steve
next reply other threads:[~2007-10-11 23:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-11 23:08 Steven Dake [this message]
2007-10-11 23:35 ` bytes received from recvmsg doesn't match FIONREAD David Miller
2007-10-11 23:36 ` David Stevens
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=1192144096.4147.16.camel@balance \
--to=sdake@redhat.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).