summaryrefslogtreecommitdiff
path: root/net/can/gw.c
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2022-09-12 20:07:19 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-09-15 10:08:08 +0300
commit96a7457a14d9cf98cf58de1e26c03180e0f28141 (patch)
tree76f566fef2733a820118b89fe7a7dbd504644903 /net/can/gw.c
parent1c679f917397f85bda93f7f9b20fb722d4b8b18d (diff)
downloadlinux-96a7457a14d9cf98cf58de1e26c03180e0f28141.tar.xz
can: skb: unify skb CAN frame identification helpers
Replace open coded checks for sk_buffs containing Classical CAN and CAN FD frame structures as a preparation for CAN XL support. With the added length check the unintended processing of CAN XL frames having the CANXL_XLF bit set can be suppressed even when the skb->len fits to non CAN XL frames. The CAN_RAW socket needs a rework to use these helpers. Therefore the use of these helpers is postponed to the CAN_RAW CAN XL integration. The J1939 protocol gets a check for Classical CAN frames too. Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/all/20220912170725.120748-2-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can/gw.c')
-rw-r--r--net/can/gw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/can/gw.c b/net/can/gw.c
index 1ea4cc527db3..23a3d89cad81 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -463,10 +463,10 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data)
/* process strictly Classic CAN or CAN FD frames */
if (gwj->flags & CGW_FLAGS_CAN_FD) {
- if (skb->len != CANFD_MTU)
+ if (!can_is_canfd_skb(skb))
return;
} else {
- if (skb->len != CAN_MTU)
+ if (!can_is_can_skb(skb))
return;
}