In some cases we can get local TX echo after remote response
for same TXed message was already received.
For applications which relay on proper order of TXed and RXed
message this will be fatal.
With this patch the package generating side will test if TX and RX are
properly ordered.
Currently with following commands, this issue can be easily
reproducible:
canfdtest -g can0 &
while(true); do chrt 40 dd if=/dev/zero of=/dev/null count=10000; done
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Scripts can be configured to handle different SIGnals and
return codes in different ways. In this case it is better
to forward received signal, instead of converting it to return 0.
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
With commit 33a9249571 ("slcand: daemonise only once setup is complete")
the daemonize syscall is moved behind serial tty setup.
This patch moves the missing assignment of the loop variable slcand_running
to get it into the code context of the while() loop.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Delay the daemon() call until the interface has been configured. This
simplifies scripts that wish to use the new interface immediately.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This is a direct consequence of not allowing bind to any device
("3cb6a1204598 j1939: socket: bind() cleanups"), i.e. can_ifindex == 0.
This means before this change jacd would receive from any interface that
was opened by another program.
Without this patch jacd fails with:
acd: bind(): No such device
A more verbose call shows the missing interface:
$ jacd -v 1122334455667788
jacd: ready for can0:1122334455667788
- socket(PF_CAN, SOCK_DGRAM, CAN_J1939);
- setsockopt(, SOL_SOCKET, SO_BINDTODEVICE, can0, 4);
- setsockopt(, SOL_CAN_J1939, SO_J1939_FILTER, <filter>, 84);
- setsockopt(, SOL_CAN_J1939, SO_J1939_RECV_OWN, 1, 4);
- bind(, :fe,0ee00,1122334455667788, 24);
jacd: bind(): No such device
Signed-off-by: Bastian Stender <bst@pengutronix.de>
canaddr2str() from testj1939 and libj1939's libj1939_addr2str provide
the same functionality. Remove the local helper function and use
libj1939_addr2str instead.
Signed-off-by: Bastian Stender <bst@pengutronix.de>
The can-j1939 kernel part only follows & validates inbound & outbound
address claim packets. Jacd implements the part that chooses an address
and emits the address claim packet.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
jsr sends data on <stdin> to j1939, and received j1939 data
is put on <stdout>.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
libj1939 provides a parser for struct sockaddr_can with j1939 info
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This configuration performs build tests for GCC and Clang
compilers.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Hardware timestamps have been introduced in Linux 2.6.30. Check for the
availability of SO_TIMESTAMPING and print an appropriate error message if
missing. Additionally fix some style issues and define the proper length
of ctrlmsg[].
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>