]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Fix bt_sock_recvmsg when MSG_TRUNC is not set
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 12 Aug 2016 12:11:28 +0000 (15:11 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 25 Aug 2016 18:58:47 +0000 (20:58 +0200)
Commit b5f34f9420b50c9b5876b9a2b68e96be6d629054 attempt to introduce
proper handling for MSG_TRUNC but recv and variants should still work
as read if no flag is passed, but because the code may set MSG_TRUNC to
msg->msg_flags that shall not be used as it may cause it to be behave as
if MSG_TRUNC is always, so instead of using it this changes the code to
use the flags parameter which shall contain the original flags.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/af_bluetooth.c

index ece45e0683fd85af7d5b9dcffdc8b92d52a20460..0b5f729d08d2b41abcfcdb1d7322d3c1ce01fa89 100644 (file)
@@ -250,7 +250,7 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 
        skb_free_datagram(sk, skb);
 
-       if (msg->msg_flags & MSG_TRUNC)
+       if (flags & MSG_TRUNC)
                copied = skblen;
 
        return err ? : copied;