Re: [PATCH net-next] af_unix: MSG_TRUNC support for dgram sockets

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

From: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Date: Wed, 22 Feb 2012 10:24:55 +0100

> Piergiorgio Beruto expressed the need to fetch size of first datagram in
> queue for AF_UNIX sockets and suggested a patch against SIOCINQ ioctl.
> 
> I suggested instead to implement MSG_TRUNC support as a recv() input
> flag, as already done for RAW, UDP & NETLINK sockets.
> 
> len = recv(fd, &byte, 1, MSG_PEEK | MSG_TRUNC);
> 
> MSG_TRUNC asks recv() to return the real length of the packet, even when
> is was longer than the passed buffer.
> 
> There is risk that a userland application used MSG_TRUNC by accident
> (since it had no effect on af_unix sockets) and this might break after
> this patch.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@xxxxxxxxx>
> Tested-by: Piergiorgio Beruto <piergiorgio.beruto@xxxxxxxxx>
> CC: Michael Kerrisk <mtk.manpages@xxxxxxxxx>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux