summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* v0.0.12HEADv0.0.12masterMarc Kleine-Budde2020-11-171-2/+2
|
* Fix attribute list size in do_get_nl_link()Wang Xin2020-11-171-1/+1
| | | | | | | | | | | | | | | | | | 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>
* libsocketcan.pc.in: remove unused fieldsMarc Kleine-Budde2018-10-051-2/+0
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* libsocketcan.pc.in: remove trailing whitespaceMarc Kleine-Budde2018-10-051-1/+1
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* Documentation/main.dox: remove trailing newlinesMarc Kleine-Budde2018-10-051-3/+1
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* v0.0.11v0.0.11Marc Kleine-Budde2018-10-051-4/+4
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* Add configure switch for error loggingMark Jonas2018-08-132-0/+21
| | | | | | | | | 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>
* Add compile option to disable error loggingLeo Ruan2018-08-081-0/+6
| | | | | | | | | 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>
* Add interface to retrieve link statisticsLeo Ruan2018-08-082-0/+41
| | | | | | | | | | | | | | | | 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>
* Get link information only from specified interfaceLeo Ruan2018-08-081-7/+24
| | | | | | | | | | | 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>
* Fix parse_rtattr() does not completely initializeLeo Ruan2018-08-081-1/+9
| | | | | | | | | 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>
* Update can_set_ctrlmode() documentationNikita Edward Baruzdin2014-07-221-18/+15
| | | | | Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* Update CAN netlink headerNikita Edward Baruzdin2014-07-221-10/+20
| | | | | Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* GNUmakefile: include LICENSE file in tarballMarc Kleine-Budde2014-03-241-2/+4
| | | | | Reported-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* configure: back to trunkMarc Kleine-Budde2014-03-241-1/+1
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* v0.0.10v0.0.10Marc Kleine-Budde2014-03-191-2/+2
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* autogen-oldtools.sh: removeMarc Kleine-Budde2014-03-191-45/+0
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* configure.ac: add hints from autoupdateRobert Schwebel2014-03-191-9/+2
| | | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* libsocketcan: Remove excess gotos.Alexander Shiyan2014-02-071-9/+5
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* libsocketcan: Fix return value for get{set}_link() functionAlexander Shiyan2014-02-061-16/+6
| | | | | | | | 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>
* Optimize can_do_restart() functionAlexander Shiyan2014-01-311-10/+1
| | | | | | | | 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>
* Use "%u" printf-format specifier for unsigned variableAlexander Shiyan2014-01-311-1/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* README: typos and beautificationYegor Yefremov2014-01-161-7/+7
| | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* build: fix bracket imbalanceJan Engelhardt2013-01-061-1/+1
| | | | | Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* build: avoid expansion of commented macrosJan Engelhardt2013-01-061-3/+3
| | | | | | | '#' 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>
* libsocketcan: add LICENSE fileWolfram Sang2012-11-281-0/+502
| | | | | | | 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>
* Use strcmp instead of sizeof on char* stringAlexander Stein2012-11-281-3/+2
| | | | | | | | | | | | 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>
* configure.ac: back to trunkMarc Kleine-Budde2012-11-061-1/+1
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* v0.0.9v0.0.9Marc Kleine-Budde2012-11-061-1/+1
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* configure.ac: enable AM_SILENT_RULESMarc Kleine-Budde2012-11-061-0/+1
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* Modified do_get_nl_link to potentially process multiple netlink dump replies.Andrew Beard2012-08-071-125/+130
| | | | | | | | | | | | 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>
* configure: fix tests/GNUmakefile.in not found regressionMarc Kleine-Budde2011-12-161-1/+0
| | | | | | | | | | | 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>
* allow linking from c++Kurt Van Dijck2011-10-181-0/+8
| | | | | | | 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>
* add can_get_device_stats()Kurt Van Dijck2011-10-182-0/+34
| | | | | | | | | | 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>
* tests: remove test exampleMarc Kleine-Budde2011-10-183-26/+1
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* libsocketcan: remove trailing whitespaceMarc Kleine-Budde2010-10-251-24/+24
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* configure: disable debug by default, turn off maintainer modeMarc Kleine-Budde2010-10-251-4/+2
| | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* switch back to trunkLuotao Fu2010-02-141-1/+1
|
* v0.0.8Luotao Fu2010-02-141-1/+1
| | | | Signed-off-by: Luotao Fu <luotao@alea.(none)>
* add berr counter call prototype to library headerLuotao Fu2010-02-141-0/+1
| | | | Signed-off-by: Luotao Fu <luotao@alea.(none)>
* change libtool library versioningLuotao Fu2010-02-141-2/+2
| | | | Signed-off-by: Luotao Fu <luotao@alea.(none)>
* add get error counter callLuotao Fu2010-02-142-3/+52
| | | | Signed-off-by: Luotao Fu <luotao@alea.(none)>
* fix header installLuotao Fu2010-02-141-4/+2
| | | | Signed-off-by: Luotao Fu <luotao@alea.(none)>
* v0.0.7v0.0.7Luotao Fu2009-12-151-1/+1
| | | | Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
* fix distinstall of can_netlink.hLuotao Fu2009-12-151-3/+3
| | | | Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
* switch back to trunkLuotao Fu2009-12-151-1/+1
| | | | Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
* v0.0.6v0.0.6Luotao Fu2009-12-151-1/+1
| | | | Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
* add dist doc filesLuotao Fu2009-12-153-0/+250
| | | | Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
* remove dependency on kernel header includeLuotao Fu2009-12-113-2/+114
| | | | | | | 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>
* fix typoLuotao Fu2009-12-111-1/+1
| | | | Signed-off-by: Luotao Fu <l.fu@pengutronix.de>