lkml.org 
[lkml]   [2007]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC
Date
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-07 10:35    [W:0.094 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site