From c45a17e96ba307ad752ac4551513559daefbefbd Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Wed, 24 Oct 2018 09:36:55 +0200 Subject: [PATCH] candump: try to switch bridge socket into CAN FD mode When using the -b/-B option to send received CAN frames to the brigde interface the sending failed when processing CAN FD frames. This patch enables CAN FD on the socket for the bridging interface. https://github.com/linux-can/can-utils/issues/104 Reported-by: https://github.com/jm3lee Signed-off-by: Oliver Hartkopp --- candump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/candump.c b/candump.c index 7da20ac..ca58439 100644 --- a/candump.c +++ b/candump.c @@ -325,6 +325,9 @@ int main(int argc, char **argv) /* disable default receive filter on this write-only RAW socket */ setsockopt(bridge, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0); + /* try to switch the bridge socket into CAN FD mode */ + setsockopt(bridge, SOL_CAN_RAW, CAN_RAW_FD_FRAMES, &canfd_on, sizeof(canfd_on)); + if (opt == 'B') { const int loopback = 0;