From: David S. Miller Date: Wed, 7 Mar 2007 01:02:35 +0000 (-0800) Subject: [NETLINK]: Mirror UDP MSG_TRUNC semantics. X-Git-Tag: v2.6.22-rc1~1128^2~411 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b558ff799977a4eda8b3823d1cf6c1c33becb671;p=linux-2.6 [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 --- diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index c48b0f49f0..5890210d77 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;