android_kernel_samsung_msm8976/net
Eric Dumazet 9f6f9af769 af_unix: MSG_TRUNC support for dgram sockets
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@gmail.com>
Tested-by: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
CC: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-22 14:47:02 -05:00
..
9p
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth
bridge
caif
can
ceph
core sock: Introduce the SO_PEEK_OFF sock option 2012-02-21 15:03:48 -05:00
dcb
dccp
decnet
dns_resolver
dsa
econet
ethernet
ieee802154 net/ieee802154/6lowpan.c: reuse eth_mac_addr() 2012-02-22 14:46:37 -05:00
ipv4 datagram: Add offset argument to __skb_recv_datagram 2012-02-21 14:58:57 -05:00
ipv6 datagram: Add offset argument to __skb_recv_datagram 2012-02-21 14:58:57 -05:00
ipx
irda
iucv
key
l2tp
lapb
llc
mac80211
netfilter
netlabel
netlink
netrom
nfc
openvswitch
packet
phonet
rds
rfkill
rose
rxrpc
sched
sctp
sunrpc
tipc
unix af_unix: MSG_TRUNC support for dgram sockets 2012-02-22 14:47:02 -05:00
wanrouter
wimax
wireless
x25
xfrm
compat.c
Kconfig
Makefile
nonet.c
socket.c
sysctl_net.c