mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 06:10:54 +07:00
[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>
This commit is contained in:
parent
b7aa0bf70c
commit
b558ff7999
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user