Skip to content

Commit

Permalink
can: isotp: restore accidentally removed MSG_PEEK feature
Browse files Browse the repository at this point in the history
In commit 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading
from socket") a new check for recvmsg flags has been introduced that
only checked for the flags that are handled in isotp_recvmsg() itself.

This accidentally removed the MSG_PEEK feature flag which is processed
later in the call chain in __skb_try_recv_from_queue().

Add MSG_PEEK to the set of valid flags to restore the feature.

Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket")
Link: linux-can/can-utils#347 (comment)
From: Derek Will <[email protected]>
Tested-by: Derek Will <[email protected]>
Signed-off-by: Oliver Hartkopp <[email protected]>
  • Loading branch information
derek-will authored and hartkopp committed Mar 28, 2022
1 parent a32302a commit bbdcc0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/can/isotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ static int isotp_recvmsg(struct kiocb *iocb, struct socket *sock,
int noblock = flags & MSG_DONTWAIT;
int ret = 0;

if (flags & ~(MSG_DONTWAIT | MSG_TRUNC))
if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
return -EINVAL;

if (!so->bound)
Expand Down

0 comments on commit bbdcc0b

Please sign in to comment.