]> git.baikalelectronics.ru Git - kernel.git/commit
can: skb: unify skb CAN frame identification helpers
authorOliver Hartkopp <socketcan@hartkopp.net>
Mon, 12 Sep 2022 17:07:19 +0000 (19:07 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 15 Sep 2022 07:08:08 +0000 (09:08 +0200)
commitd99e6da81f16427e6e999da8595cfa6a97c554f6
tree76f566fef2733a820118b89fe7a7dbd504644903
parentb4e63532a3671de5792eed17c77074d4d8ed1b3f
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>
drivers/net/can/dev/skb.c
include/linux/can/skb.h
net/can/af_can.c
net/can/bcm.c
net/can/gw.c
net/can/isotp.c
net/can/j1939/main.c