From ced84cab120a1ddde2bd4561a18514707c8a6184 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Wed, 15 Jan 2020 20:29:26 +0100 Subject: [PATCH] can-isotp: fix CAN_REQUIRED_SIZE argument 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 --- net/can/isotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/can/isotp.c b/net/can/isotp.c index 5f062b1..a0d20d9 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -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