Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;