diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-03-06 20:02:35 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:23:35 -0400 |
commit | b558ff799977a4eda8b3823d1cf6c1c33becb671 (patch) | |
tree | b68b90c1891120e2904fd5b68d9192ef6ae74d43 /net/netlink/af_netlink.c | |
parent | b7aa0bf70c4afb9e38be25f5c0922498d0f8684c (diff) |
[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>
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r-- | net/netlink/af_netlink.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index c48b0f49f003..5890210d7730 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, | |||
1242 | 1242 | ||
1243 | scm_recv(sock, msg, siocb->scm, flags); | 1243 | scm_recv(sock, msg, siocb->scm, flags); |
1244 | 1244 | ||
1245 | if (flags & MSG_TRUNC) | ||
1246 | copied = skb->len; | ||
1247 | |||
1245 | out: | 1248 | out: |
1246 | netlink_rcv_wake(sk); | 1249 | netlink_rcv_wake(sk); |
1247 | return err ? : copied; | 1250 | return err ? : copied; |