We don't need to block any signals, so a select() is sufficient. This
also fixes the problem that sigmask is uninitialized and may block the
sig ARLM, which make canbusload hang until a CAN frame is recieved.
Closes: https://github.com/linux-can/can-utils/issues/465
If CAN_ERR_CNT is set, the snprintf_can_error_frame() bails out, as it
cannot decode CAN_ERR_CNT.
Fixes: 21fb43532e ("lib: snprintf_can_error_frame: print counter errors if CAN_ERR_CNT is set")
In 913311fc15 ("can-calc-bit-timing: add support to decode user
supplied bit timing parameters") support to decide user supplied bit
timing parameters was added. However, it was forgotten to add --tq to
the help text.
Add help text for the --tq paramter.
Reported-by: https://github.com/EnricoMontecaggi
Closes: https://github.com/linux-can/can-utils/issues/459
Fixes: 913311fc15 ("can-calc-bit-timing: add support to decode user supplied bit timing parameters")
Commit 0be066bee6 ("cansequence: main(): allow to bind on "any"
interface") converted from SIOCGIFINDEX ioctl() to if_nametoindex()
and adjusted the error message, but forgot the "()" after the function
name, which is used in the rest of the error messages in this file.
Add the missing "()".
Fixes: 0be066bee6 ("cansequence: main(): allow to bind on "any" interface")
In commit 9567230494 ("cansequence: print out dropped packages by
socket counter"), the read() syscall was replaced by recvmsg(). Adjust
error message accordingly.
Fixes: 9567230494 ("cansequence: print out dropped packages by socket counter")
It is not implemented and not supported by any of the can-utils, so
remove it.
Reported-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
"errno" hold the positive error value.
Link: https://github.com/linux-can/can-utils/issues/448
Fixes: cc155d2f63 ("j1939cat: make use of new RX UAPI")
Fixes: 19d41bec45 ("jcat: allow to re-send rest of the buffer if we was interrupted")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
The check has only been applied after the first CAN frame has been read
and evaluated. This lead to an unintended sending of a single handcrafted
frame with a following (intended) failure at the second frame.
Apply the check also for the very first CAN frame that is processed.
Fixes: ee0233505b ("canplayer: ensure 6 decimal places in timestamp")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
By using C99 initializers for struct sockaddr_can addr the not
assigned members are automatically set to 0x0, resulting in not
passing uninitialized memory to the bind() syscall.
Also remove the printing of the socket family, type and proto, this
was interesting back in the days, when the numbers were not fixed, yet.
By using C99 initializers for struct sockaddr_can addr the not
assigned members are automatically set to 0x0, resulting in not
passing uninitialized memory to the bind() syscall.
The ASC file banner, e.g.
date Thu Jan 1 01:00:00 1970
base hex timestamps absolute
no internal events logged
should be printed when the first timestamp from the logfile has been
processed. But for logfiles starting with zero (e.g. candump -tz option)
this banner is printed every time the timestamps seconds equals zero.
As it was obviously not a good idea to stick the condition for printing
the banner based on some assumption about the timestamp a new variable
'print_banner' has been introduced.
Reported-by: https://github.com/CaSchmidt
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
When canbusload is executed without bit rate, it exits with an exit
code of 1 and prints help, but without explaining why. Users cannot
know what was wrong. When other errors occur, though, canbusload
prints an error message along with the help.
Print an error message when bit rate is not given or "@" is not found.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
The check for CAN FD capable interfaces only checked for CANFD_MTU to
enable the generation of CAN FD frame content. As CAN XL capable CAN
interfaces are able to handle CAN FD frames too the check has to be
extended for CANXL_MTU interfaces.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
The check for CAN FD capable interfaces only checked for CANFD_MTU to
enable the generation of CAN FD frame content. As CAN XL capable CAN
interfaces are able to handle CAN FD frames too the check has to be
extended for CANXL_MTU interfaces.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Systems that lack a MMU cannot use fork() to create the child process.
The patch does not compile the affected programs on MMU-less systems.
Co-developed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
| cangen.c: In function ‘parse_dataoptarg’:
| cangen.c:422:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
| for (int i = 0; i < CANFD_MAX_DLEN && i < arglen / 2; i++) {
| ^
| cangen.c:422:2: note: use option -std=c99 or -std=gnu99 to compile your code
| cangen.c: In function ‘main’:
| cangen.c:796:4: error: ‘for’ loop initial declarations are only allowed in C99 mode
| for (int i = 0; i < frame.len; i++) {
| ^
Reported-by: https://github.com/yannS2016
Link: https://github.com/linux-can/can-utils/issues/428
Fixes: e409aa4c8c ("cangen: new generation mode - partially randomized payload (-D)")
| cangen.c: In function ‘parse_dataoptarg’:
| cangen.c:422:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
| for (int i = 0; i < CANFD_MAX_DLEN && i < arglen / 2; i++) {
| ^
| cangen.c:422:2: note: use option -std=c99 or -std=gnu99 to compile your code
| cangen.c: In function ‘main’:
| cangen.c:796:4: error: ‘for’ loop initial declarations are only allowed in C99 mode
| for (int i = 0; i < frame.len; i++) {
| ^
Reported-by: https://github.com/yannS2016
Link: https://github.com/linux-can/can-utils/issues/428
Fixes: e409aa4c8c ("cangen: new generation mode - partially randomized payload (-D)")