lkml.org 
[lkml]   [2022]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v2 0/2] can: drop tx skb if the device is in listen only mode
Date
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
skb.

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
skb.c
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(-)

--
2.35.1

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