| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function do_get_nl_link() retrieves attributes from the response
RTM_NEWLINK. But it calculates the attribute list size with the wrong
structure struct ifaddrmsg. According to man 7 rtnetlink, RTM_NEWLINK
message uses struct ifinfomsg instead of struct ifaddrmsg. This causes
that additional 8 bytes are parsed and garbage attributes might be
retrieved. One of consequences is that the message will be dropped if
the garbage attribute is IFLA_IFNAME and contains an invalid interface
name.
To fix this issue, use struct ifinfomsg to calculate the size of
attribute list for RTM_NEWLINK.
Signed-off-by: Wang Xin <xin.wang7@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
For keeping backwards compatibility the configure switch
--enable-error-log is enabled by default. To disable error logging
use --enable-error-log=no.
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
If you have an application stderr shall not be used by libsocketcan
you can disable all error logging by defining DISABLE_ERROR_LOG.
Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds an interface to get the statistics (64-bits) from
CAN interface. See more information from /usr/include/linux/if_link.h
where defines the struct rtnl_link_stats64.
Compare to the rtnl_link_stats, rtnl_link_stats64 was introduced
since linux kernel 2.6. After that the rtnl_link_stats is synchronous
with struct rtnl_link_stats64 by truncating each member from 64 bits
to 32 bits. Actually, the struct rtnl_link_stats is kept for
compatibility.
Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
libsocketcan always retrieves link information from all interfaces
instead of only specified one. This commit fixes the issue by appending
an interface information to dump request netlink message.
See man 7 rtnetlink for detail description in section 'RTM_GETLINK'.
Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Because max is the index of the last element in array tb, max+1
elements need to be initialized.
Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
| |
Reported-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
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>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
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:
42a3b65198f65134ac049172d5c9b998ae6220de tests: remove test example
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
|
|
|
| |
libsocketcan with c++ fails linking.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
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>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
| |
|
|
|
|
| |
Signed-off-by: Luotao Fu <luotao@alea.(none)>
|
|
|
|
| |
Signed-off-by: Luotao Fu <luotao@alea.(none)>
|
|
|
|
| |
Signed-off-by: Luotao Fu <luotao@alea.(none)>
|
|
|
|
| |
Signed-off-by: Luotao Fu <luotao@alea.(none)>
|
|
|
|
| |
Signed-off-by: Luotao Fu <luotao@alea.(none)>
|
|
|
|
| |
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Luotao Fu <l.fu@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>
|
|
|
|
| |
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
|