can: isotp: TX-path: ensure that CAN frame flags are initialized
authorMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 18 Feb 2021 20:24:20 +0000 (21:24 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 16 Mar 2021 07:40:04 +0000 (08:40 +0100)
commitd4eb538e1f48b3cf7bb6cb9eb39fe3e9e8a701f7
tree1c6303e2034ca42eae0fcbe84c6eafb8d96e9f46
parente4912459bd5edd493b61bc7c3a5d9b2eb17f5a89
can: isotp: TX-path: ensure that CAN frame flags are initialized

The previous patch ensures that the TX flags (struct
can_isotp_ll_options::tx_flags) are 0 for classic CAN frames or a user
configured value for CAN-FD frames.

This patch sets the CAN frames flags unconditionally to the ISO-TP TX
flags, so that they are initialized to a proper value. Otherwise when
running "candump -x" on a classical CAN ISO-TP stream shows wrongly
set "B" and "E" flags.

| $ candump any,0:0,#FFFFFFFF -extA
| [...]
| can0  TX B E  713   [8]  2B 0A 0B 0C 0D 0E 0F 00
| can0  TX B E  713   [8]  2C 01 02 03 04 05 06 07
| can0  TX B E  713   [8]  2D 08 09 0A 0B 0C 0D 0E
| can0  TX B E  713   [8]  2E 0F 00 01 02 03 04 05

Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol")
Link: https://lore.kernel.org/r/20210218215434.1708249-2-mkl@pengutronix.de
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/isotp.c