Re: udp(7) and MSG_TRUNC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <Pine.NEB.4.60.0407212102370.20795@norge.freeshell.org> (at Wed, 21 Jul 2004 21:27:30 +0000 (UTC)), Alexey Toptygin <alexeyt@freeshell.org> says:

> On Wed, 21 Jul 2004, David S. Miller wrote:
> 
> > On Mon, 12 Jul 2004 22:34:34 +0000 (UTC)
> > Alexey Toptygin <alexeyt@freeshell.org> wrote:
> >
> >> But, in both 2.4 and 2.6 it doesn't seem to be honoring that.
> >
> > It is honoring the man page section that you are quoting.
> > On return from recvmsg() UDP will set MSG_TRUNC in the
> > msg_flags if the users's buffer is smaller than the packet
> > length.
> >
> > The patch you have made reference to does something different,
> > if MSG_TRUNC is passed _IN_ to recvmsg() by the user, this
> > modifies what length will be returned.
> 
> Sorry, I was quoting the wrong man page. I wanted to quote recv(2) where 
> it says:
> 
>      MSG_TRUNC
>  	Return  the  real  length of the packet, even when it was longer
>  	than the passed buffer. Only valid for packet sockets.

Well, by the spec. (Open Group Base Specifications, Issue 6),
recv(2) and recvfrom(2) shall return "the length of the message written 
to the buffer pointed to by the buffer argument."
So, current code conforms to this.
(On the other hand, the spec just says that recvmsg(2) shall return 
"the total length of the message;" Hmm?)

-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux