From 7affaf217eee76211adf0aa2b23411ad40999293 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Fri, 8 Dec 2023 17:06:36 +0100 Subject: [PATCH] isotpsniffer: fix missing CAN FD support on second listen socket When sniffing CAN FD isotp traffic both listen-only sockets have to be switched to process CAN FD frames. Signed-off-by: Oliver Hartkopp --- isotpsniffer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/isotpsniffer.c b/isotpsniffer.c index f976149..5764c66 100644 --- a/isotpsniffer.c +++ b/isotpsniffer.c @@ -304,6 +304,12 @@ int main(int argc, char **argv) setsockopt(s, SOL_CAN_ISOTP, CAN_ISOTP_OPTS, &opts, sizeof(opts)); + if ((llopts.mtu) && (setsockopt(s, SOL_CAN_ISOTP, CAN_ISOTP_LL_OPTS, &llopts, sizeof(llopts))) < 0) { + perror("setsockopt"); + r = 1; + goto out; + } + addr.can_addr.tp.tx_id = src; addr.can_addr.tp.rx_id = dst;