Commit Graph

19 Commits (ef6c39ebd6b53b009b043cc06728015291884b6d)

Author SHA1 Message Date
Yasushi SHOJI 180eceff4d isotptun: Follow Bash exit status when signaled
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit.  Follow the common behavior so that we
know how the programs are killed.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2023-03-20 10:22:30 +09:00
Oliver Hartkopp dfb607c807 remove obsolete char pointer casts
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2022-03-14 18:21:45 +01:00
Rosen Penev b153fe3f35
clang-tidy: sort includes alphabetically
Found with llvm-include-order

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:58 -07:00
Alexander Gerasiov 89c66aba5f isotptun.c: Reformat help/usage output to be compatible with help2man.
Signed-off-by: Alexander Gerasiov <gq@debian.org>

Gbp-Pq: Name 0018-isotptun.c-Reformat-help-usage-output-to-be-compatib.patch
2020-04-27 08:20:09 +03:00
Oliver Hartkopp 1331c56393 isotptun: fix stringop-truncation warnings
Rework string handling for ioctl() syscalls for netdev name operations.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2019-08-25 18:20:37 +02:00
Yegor Yefremov 7b7331976a Add SPDX identifiers
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-06-19 12:24:24 +02:00
Marko Kohtala 35f3dc375b isotptun: add -D option to daemonize after tun device created
System startup needs to wait for tun device to be created before
continuing on use of the tun device. Add -D option to fork a daemon of
isotptun and exit(EXIT_SUCCESS) when the tun device can be used.

Log errors to syslog when daemonized or to stderr when in foreground.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:16:07 +02:00
Marko Kohtala 51192feff8 isotptun: print command line parsing error messages to stderr
Command line parsing error messages are printed to stdout. Other errors
and usage goes to stderr.

Change to print errors to stderr.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:14:29 +02:00
Marko Kohtala 7eb005d9f3 isotptun: use EXIT_FAILURE instead of 0 (EXIT_SUCCESS) for errors
Exit code does not tell if the service was provided or if it was not
provided due to command line or setup errors.

Change errors to return EXIT_FAILURE instead of 0. Also change other uses
of 0 to EXIT_SUCCESS and 1 to EXIT_FAILURE for clarity and POSIX
conformance.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:12:51 +02:00
Sven Schmitt f5fb7317aa treewide: use if_nametoindex to avoid overflows
replaced strcpy(if_name, argv[x]) + ioctl by if_idx = if_nametoindex(argv[x])
to avoid overflows caused by long user input.

Signed-off-by: Sven Schmitt <sven.schmitt@gmx.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-30 21:00:04 +02:00
Oliver Hartkopp dabe592f45 isotp[server|tun]: update padding and CAN FD features
Update padding and CAN FD features according to the latest isotpsend and
isotprecv changes.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2014-11-23 12:15:57 +01:00
Oliver Hartkopp 9c5bfab229 isotp: fix copy paste error for isotp padding config
Thanks for the anonymous hint, Mr X ;-)

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2014-10-23 19:07:54 +02:00
Oliver Hartkopp 836d3cc012 remove obsolete SVN ID tags
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2012-11-14 20:57:16 +01:00
Marc Kleine-Budde 722a09116d treewide: replace berlios contact email by linux-can@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-01-11 12:14:15 +01:00
Oliver Hartkopp f135ce3d47 Allow to specify the name of the IP tunnel netdevice via commandline option '-n <name>' 2009-11-25 17:15:09 +00:00
Oliver Hartkopp d68d6132da Remove feature to quit the isotptun by keypress (from stdin) as it was not possible to run it from a start-script.
Added a signal handler to gracefully leave the isotptun.
2009-11-25 16:43:17 +00:00
Oliver Hartkopp 4369ac1c55 Consistencely allow '-?' to get a help text. 2009-01-13 09:32:45 +00:00
Oliver Hartkopp 4e41082935 Added Id keyword propertiy on new files. 2008-11-05 14:20:52 +00:00
Oliver Hartkopp f1d4ebbbba Added ISO 15765-2 CAN transport protocol for protocol family CAN.
Including some tools and coarse documentation README.isotp
2008-11-05 11:34:23 +00:00