Skip to content

Commit

Permalink
[NETLINK]: Mirror UDP MSG_TRUNC semantics.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Apr 26, 2007
1 parent b7aa0bf commit b558ff7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b558ff7

Please sign in to comment.