netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible bug in netlink_recvmsg()
@ 2007-04-13 18:08 David Howells
  2007-04-13 21:11 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2007-04-13 18:08 UTC (permalink / raw)
  To: netdev


As I understand it, according to the recvmsg() manual page, if the packet
being returned is larger than the buffer provided, and the protocol does not
support piecemeal reception of data, then:

 (1) the buffer should be filled,

 (2) MSG_TRUNC should be set in msg_flags, and

 (3) the length of the full packet, including the discarded bit should be
     returned.

AF_NETLINK sockets, however, do not do (3).  See this bit in netlink_recvmsg():

	copied = skb->len;
	if (len < copied) {
		msg->msg_flags |= MSG_TRUNC;
		copied = len;
	}

Or is this only true if the caller of recvmsg() passes MSG_TRUNC in?

David

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

end of thread, other threads:[~2007-04-19 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-13 18:08 Possible bug in netlink_recvmsg() David Howells
2007-04-13 21:11 ` David Miller
2007-04-19 16:07   ` David Howells

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