netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Subject: Possible bug in netlink_recvmsg()
Date: Fri, 13 Apr 2007 19:08:31 +0100	[thread overview]
Message-ID: <1864.1176487711@redhat.com> (raw)


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

             reply	other threads:[~2007-04-13 18:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13 18:08 David Howells [this message]
2007-04-13 21:11 ` Possible bug in netlink_recvmsg() David Miller
2007-04-19 16:07   ` David Howells

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=1864.1176487711@redhat.com \
    --to=dhowells@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).