This patch makes return value negative when open_nl_sock() function
fail and removes excess labels.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch optimizes can_do_restart() function by reusing some part
of code from existing set_link() function.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
'#' does not ignore the line at the m4 level, "dnl" does.
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Took LGPL v2.1+ from the FSF website which is stated in libsocketcan.c.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This bug was detected by the clang warning:
libsocketcan.c:384:16: warning: argument to 'sizeof' in 'strncmp' call
is the same expression as the source; did you mean to provide an
explicit length? [-Wsizeof-pointer-memaccess]
sizeof(name)) != 0)
~~~~~~~^~~~~~
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Prior to this commit, do_get_nl_link assumed there would only be a single
reply for a dump request. On my system with multiple can interfaces, this
would cause only half of them to be listed in the dump reply. This change
checks for NLMSG_DONE dump terminator and stops receiving messages once
received.
Signed-off-by: Andrew Beard <abeard@ovro.caltech.edu>
[mkl: fix indention, move variable init out of loop]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch fixes the following problem:
configure.ac:108: required file `tests/GNUmakefile.in' not found
which has been introduced in commit:
42a3b65198 tests: remove test example
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
When using libsocketcan on git://git.pengutronix.de/git/tools/libsocketcan.git,
I kind of missed a method to fetch the can device statistics.
This patch adds that functionality.
I think this is the proper library to put such function.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
make a local copy of the can/netlink.h. This way we don't have to include a
kernel include directory to build any more.
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
we now have can_set_bitrate and can_set_bitrate_samplepoint. The second is for
convenience for the developer. We tend to let the kernel use CIA recommnended
sample point value, which can_set_bitrate simply does
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
We don't do if_up/down internally any longer, since it is depreacated. Instead
we add now can_start/stop callbacks and let the user do the job themselves in
threir applications.
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>