projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b7aa0bf
)
[NETLINK]: Mirror UDP MSG_TRUNC semantics.
author
David S. Miller
<davem@sunset.davemloft.net>
Wed, 7 Mar 2007 01:02:35 +0000
(17:02 -0800)
committer
David S. Miller
<davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:23:35 +0000
(22:23 -0700)
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>
net/netlink/af_netlink.c
patch
|
blob
|
history
diff --git
a/net/netlink/af_netlink.c
b/net/netlink/af_netlink.c
index c48b0f49f00362d1ec7ed5625a1ab8e6d73bf946..5890210d77301eeb49d308fe6cf472965d3be7c0 100644
(file)
--- 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,
scm_recv(sock, msg, siocb->scm, flags);
+ if (flags & MSG_TRUNC)
+ copied = skb->len;
+
out:
netlink_rcv_wake(sk);
return err ? : copied;