Commit b558ff79 authored by David S. Miller's avatar David S. Miller
Browse files

[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: default avatarDavid S. Miller <davem@davemloft.net>
parent b7aa0bf7
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment