linux/net/can
Alexander Hölzl 44de577e61 can: j1939: j1939_sk_send_loop(): fix unable to send messages with data length zero
The J1939 standard requires the transmission of messages of length 0.

For example proprietary messages are specified with a data length of 0
to 1785. The transmission of such messages is not possible. Sending
results in no error being returned but no corresponding can frame
being generated.

Enable the transmission of zero length J1939 messages. In order to
facilitate this two changes are necessary:

1) If the transmission of a new message is requested from user space
the message is segmented in j1939_sk_send_loop(). Let the segmentation
take into account zero length messages, do not terminate immediately,
queue the corresponding skb.

2) j1939_session_skb_get_by_offset() selects the next skb to transmit
for a session. Take into account that there might be zero length skbs
in the queue.

Signed-off-by: Alexander Hölzl <alexander.hoelzl@gmx.net>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20250205174651.103238-1-alexander.hoelzl@gmx.net
Fixes: 9d71dd0c70 ("can: add support of SAE J1939 protocol")
Cc: stable@vger.kernel.org
[mkl: commit message rephrased]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2025-02-08 11:28:57 +01:00
..
j1939 can: j1939: j1939_sk_send_loop(): fix unable to send messages with data length zero 2025-02-08 11:28:57 +01:00
af_can.c net: af_can: do not leave a dangling sk pointer in can_create() 2024-10-15 18:43:08 -07:00
af_can.h
bcm.c can: bcm: Clear bo->bcm_proc_read after remove_proc_entry(). 2024-09-12 09:40:08 +02:00
gw.c can: gw: Use rtnl_register_many(). 2024-10-15 18:52:26 -07:00
isotp.c can: isotp: remove ISO 15675-2 specification version where possible 2024-06-20 11:52:56 +02:00
Kconfig can: isotp: remove ISO 15675-2 specification version where possible 2024-06-20 11:52:56 +02:00
Makefile
proc.c
raw.c sock: support SO_PRIORITY cmsg 2024-12-16 18:13:44 -08:00