netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bytes received from recvmsg doesn't match FIONREAD
@ 2007-10-11 23:08 Steven Dake
  2007-10-11 23:35 ` David Miller
  2007-10-11 23:36 ` David Stevens
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Dake @ 2007-10-11 23:08 UTC (permalink / raw)
  To: netdev

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-11 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-11 23:08 bytes received from recvmsg doesn't match FIONREAD Steven Dake
2007-10-11 23:35 ` David Miller
2007-10-11 23:36 ` David Stevens

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).