Skip to content

Commit

Permalink
can-isotp: fix CAN_REQUIRED_SIZE argument
Browse files Browse the repository at this point in the history
In fact we need to take care to get the tp related values for rx_id and tx_id
and not only the can_ifindex.

Signed-off-by: Oliver Hartkopp <[email protected]>
  • Loading branch information
hartkopp committed Jan 15, 2020
1 parent fbed98a commit ced84ca
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 @@ -1097,7 +1097,7 @@ static int isotp_bind(struct socket *sock, struct sockaddr *uaddr, int len)
int notify_enetdown = 0;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0)
if (len < CAN_REQUIRED_SIZE(*addr, can_ifindex))
if (len < CAN_REQUIRED_SIZE(struct sockaddr_can, can_addr.tp))
#else
if (len < sizeof(*addr))
#endif
Expand Down

0 comments on commit ced84ca

Please sign in to comment.