summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-03-07 02:02:35 +0100
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 07:23:35 +0200
commitb558ff799977a4eda8b3823d1cf6c1c33becb671 (patch)
treeb68b90c1891120e2904fd5b68d9192ef6ae74d43 /net
parent[NET]: convert network timestamps to ktime_t (diff)
downloadlinux-b558ff799977a4eda8b3823d1cf6c1c33becb671.tar.xz
linux-b558ff799977a4eda8b3823d1cf6c1c33becb671.zip
[NETLINK]: Mirror UDP MSG_TRUNC semantics.
If the user passes MSG_TRUNC in via msg_flags, return the full packet size not the truncated size. Idea from Herbert Xu and Thomas Graf. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netlink/af_netlink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c48b0f49f003..5890210d7730 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1242,6 +1242,9 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
scm_recv(sock, msg, siocb->scm, flags);
+ if (flags & MSG_TRUNC)
+ copied = skb->len;
+
out:
netlink_rcv_wake(sk);
return err ? : copied;