Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

can: dev: fix missing CAN XL support in can_put_echo_skb()

can_put_echo_skb() checks for the enabled IFF_ECHO flag and the
correct ETH_P type of the given skbuff. When implementing the CAN XL
support the new check for ETH_P_CANXL has been forgotten.

Fixes: fb08cba12b52 ("can: canxl: update CAN infrastructure for CAN XL frames")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20230506184515.39241-1-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Oliver Hartkopp and committed by
Marc Kleine-Budde
6bffdc38 1db080cb

+2 -1
+2 -1
drivers/net/can/dev/skb.c
··· 54 54 /* check flag whether this packet has to be looped back */ 55 55 if (!(dev->flags & IFF_ECHO) || 56 56 (skb->protocol != htons(ETH_P_CAN) && 57 - skb->protocol != htons(ETH_P_CANFD))) { 57 + skb->protocol != htons(ETH_P_CANFD) && 58 + skb->protocol != htons(ETH_P_CANXL))) { 58 59 kfree_skb(skb); 59 60 return 0; 60 61 }