public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kabs <dkabs@mobotix.com>
To: David Miller <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC
Date: Wed, 7 Feb 2007 10:31:57 +0100	[thread overview]
Message-ID: <200702071031.58463.dkabs@mobotix.com> (raw)
In-Reply-To: <20070204.165235.26305735.davem@davemloft.net>

On Monday 05 February 2007 01:52, David Miller wrote:
> What UDP is doing is different, it's returning the full packet length
> when the packet is larger then the given buffer size, but it does this
> irregardless of whether you set MSG_TRUNC in the recvmsg() passed-in
> flags.  UDP itself sets the MSG_TRUNC flag when it detects this
> situation.

I hope that I am researching the appropriate kernel source tree, but if I 
am not mistaken, this behaviour was introduced with change 1.66 according 
to bitkeeper:
  http://linux.bkbits.net:8080/linux-2.6/net/ipv4/udp.c?PAGE=history

I think the bitkeeper comment on that change (1.66) is misleading:
  "[UDP]: Return true length if user specifies MSG_TRUNC."

As you said, this is wrong. The true length is returned, regardless 
whether the user specified MSG_TRUNC.

Exploring this topic I learned a lot about browsing and reading kernel 
source code, e.g. that commit statements have to be taken with a grain of 
salt :-)

Cheers
Daniel

      parent reply	other threads:[~2007-02-07  9:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 11:59 Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC Daniel Kabs
2007-02-05  0:52 ` David Miller
2007-02-06 12:55   ` Daniel Kabs
2007-02-06 20:11     ` David Schwartz
2007-02-07  8:58       ` Daniel Kabs
2007-02-07  9:31   ` Daniel Kabs [this message]

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=200702071031.58463.dkabs@mobotix.com \
    --to=dkabs@mobotix.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@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