Skip to content

Commit

Permalink
Bluetooth: Fix bt_sock_recvmsg when MSG_TRUNC is not set
Browse files Browse the repository at this point in the history
Commit b5f34f9 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 <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
Vudentz authored and holtmann committed Aug 25, 2016
1 parent dbb5088 commit 90a56f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/af_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 90a56f7

Please sign in to comment.