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 <socketcan@hartkopp.net>
pull/142/head
Oliver Hartkopp 2018-10-24 09:36:55 +02:00
parent 8681e57230
commit c45a17e96b
1 changed files with 3 additions and 0 deletions

View File

@ -325,6 +325,9 @@ int main(int argc, char **argv)
/* disable default receive filter on this write-only RAW socket */ /* disable default receive filter on this write-only RAW socket */
setsockopt(bridge, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0); 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') { if (opt == 'B') {
const int loopback = 0; const int loopback = 0;