[lkml]   [2022]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v2 0/2] can: drop tx skb if the device is in listen only mode
In listen only mode, tx CAN frames can still reach the driver if
injected via the packet socket. This series add a check toward
CAN_CTRLMODE_LISTENONLY in can_dropped_invalid_skb() to discard such

The first patch does some preparation work and migrates
can_dropped_invalid_skb() and can_skb_headroom_valid() from skb.h to
skb.c. This preparation is needed because skb.h does not include
linux/can/dev.h (for struct can_priv) and uapi/linux/can/netlink.h
(for the definition of CAN_CTRLMODE_LISTEONLY) which we need for this
change. The function being already big, better to de-inline them and
move them to a .c file.

The second and last patch is the actual change.

* Changelog *

v1 -> v2

* move can_dropped_invalid_skb() to skb.c instead of dev.h

* also move can_skb_headroom_valid() to skb.c

Vincent Mailhol (2):
can: skb:: move can_dropped_invalid_skb and can_skb_headroom_valid to
can: dev: drop tx skb if in listen only mode

drivers/net/can/dev/skb.c | 65 +++++++++++++++++++++++++++++++++++++++
include/linux/can/skb.h | 59 +----------------------------------
2 files changed, 66 insertions(+), 58 deletions(-)


 \ /
  Last update: 2022-05-13 17:38    [W:0.721 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site