Skip to contentSkip to conversation

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

PATCH New Oliver Hartkopp 1 participant 1 message May 6, 2023 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/can/dev/skb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/can/dev/skb.c +2 -1
index 241ec636e91f..f6d05b3ef59a 100644
@@ -52,11 +52,12 @@ int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
 	BUG_ON(idx >= priv->echo_skb_max);
 
 	/* check flag whether this packet has to be looped back */
 	if (!(dev->flags & IFF_ECHO) ||
 	    (skb->protocol != htons(ETH_P_CAN) &&
-	     skb->protocol != htons(ETH_P_CANFD))) {
+	     skb->protocol != htons(ETH_P_CANFD) &&
+	     skb->protocol != htons(ETH_P_CANXL))) {
 		kfree_skb(skb);
 		return 0;
 	}
 
 	if (!priv->echo_skb[idx]) {
Signature · 1 line
2.39.2