]> git.baikalelectronics.ru Git - kernel.git/commit
can: j1939: transport: add j1939_session_skb_find_by_offset() function
authorOleksij Rempel <o.rempel@pengutronix.de>
Fri, 7 Aug 2020 10:51:59 +0000 (12:51 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 14 Aug 2020 10:38:47 +0000 (12:38 +0200)
commit37c0e8abc83102fd18f33f6d30659f0dd228f746
treea2e6c95d36ae1f2839703d737a202c161b07cb5f
parenta88be2bbbaa1743bc65ec7eb2ad10f95181a82bb
can: j1939: transport: add j1939_session_skb_find_by_offset() function

Sometimes it makes no sense to search the skb by pkt.dpo, since we need
next the skb within the transaction block. This may happen if we have an
ETP session with CTS set to less than 255 packets.

After this patch, we will be able to work with ETP sessions where the
block size (ETP.CM_CTS byte 2) is less than 255 packets.

Reported-by: Henrique Figueira <henrislip@gmail.com>
Reported-by: https://github.com/linux-can/can-utils/issues/228
Fixes: c4da2dabb66d ("can: add support of SAE J1939 protocol")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/20200807105200.26441-5-o.rempel@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/j1939/transport.c