aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Devoogdt <thomas@devoogdt.com>2024-10-04 15:32:55 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2024-10-06 18:25:01 +0200
commit8953429a8253176adda4dcfbed4738e55ee3b8ea (patch)
tree6abebdd1fcb223ee55a6210f659532c37165ddd9
parentbf57f732a5b6842f6fa3e0f90385f039e5d6a92c (diff)
downloadbusybox-w32-8953429a8253176adda4dcfbed4738e55ee3b8ea.tar.gz
busybox-w32-8953429a8253176adda4dcfbed4738e55ee3b8ea.tar.bz2
busybox-w32-8953429a8253176adda4dcfbed4738e55ee3b8ea.zip
networking/libiproute/iplink.c: fix support for older kernels
- The CAN netlink interface has been added in Linux v2.6.31 with only 3 options [1]: CAN_CTRLMODE_LOOPBACK 0x1 /* Loopback mode */ CAN_CTRLMODE_LISTENONLY 0x2 /* Listen-only mode */ CAN_CTRLMODE_3_SAMPLES 0x4 /* Triple sampling mode */ So define the other options. - IFLA_CAN_TERMINATION has been added in Linux 4.11 [2], define it for older kernels. [1] https://github.com/torvalds/linux/blob/v2.6.31/include/linux/can/netlink.h#L80-L82 [2] https://github.com/torvalds/linux/commit/12a6075cabc0d9ffbc0366b44daa22f278606312 Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/libiproute/iplink.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index 37ed114bc..67602a466 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -51,6 +51,27 @@ struct ifla_vlan_flags {
51}; 51};
52#endif 52#endif
53 53
54#if ENABLE_FEATURE_IP_LINK_CAN
55# ifndef CAN_CTRLMODE_ONE_SHOT
56# define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */
57# endif
58# ifndef CAN_CTRLMODE_BERR_REPORTING
59# define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */
60# endif
61# ifndef CAN_CTRLMODE_FD
62# define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */
63# endif
64# ifndef CAN_CTRLMODE_PRESUME_ACK
65# define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */
66# endif
67# ifndef CAN_CTRLMODE_FD_NON_ISO
68# define CAN_CTRLMODE_FD_NON_ISO 0x80 /* CAN FD in non-ISO mode */
69# endif
70# ifndef IFLA_CAN_TERMINATION
71# define IFLA_CAN_TERMINATION 11
72# endif
73#endif
74
54/* taken from linux/sockios.h */ 75/* taken from linux/sockios.h */
55#define SIOCSIFNAME 0x8923 /* set interface name */ 76#define SIOCSIFNAME 0x8923 /* set interface name */
56 77