mac80211: fix a regression in the minstrel_ht improvement patches
[openwrt/staging/chunkeey.git] / package / network / utils / iproute2 / patches / 001-devlink-fix-libc-and-kernel-headers-collision.patch
1 From d0272f5404773a60cbc17c2277affdbbf8d99c67 Mon Sep 17 00:00:00 2001
2 From: Baruch Siach <baruch@tkos.co.il>
3 Date: Thu, 27 Jun 2019 21:37:19 +0300
4 Subject: devlink: fix libc and kernel headers collision
5
6 Since commit 2f1242efe9d ("devlink: Add devlink health show command") we
7 use the sys/sysinfo.h header for the sysinfo(2) system call. But since
8 iproute2 carries a local version of the kernel struct sysinfo, this
9 causes a collision with libc that do not rely on kernel defined sysinfo
10 like musl libc:
11
12 In file included from devlink.c:25:0:
13 .../sysroot/usr/include/sys/sysinfo.h:10:8: error: redefinition of 'struct sysinfo'
14 struct sysinfo {
15 ^~~~~~~
16 In file included from ../include/uapi/linux/kernel.h:5:0,
17 from ../include/uapi/linux/netlink.h:5,
18 from ../include/uapi/linux/genetlink.h:6,
19 from devlink.c:21:
20 ../include/uapi/linux/sysinfo.h:8:8: note: originally defined here
21 struct sysinfo {
22 ^~~~~~~
23
24 Move the sys/sysinfo.h userspace header before kernel headers, and
25 suppress the indirect include of linux/sysinfo.h.
26
27 Cc: Aya Levin <ayal@mellanox.com>
28 Cc: Moshe Shemesh <moshe@mellanox.com>
29 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
30 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
31 ---
32 devlink/devlink.c | 3 ++-
33 1 file changed, 2 insertions(+), 1 deletion(-)
34
35 --- a/devlink/devlink.c
36 +++ b/devlink/devlink.c
37 @@ -18,11 +18,12 @@
38 #include <limits.h>
39 #include <errno.h>
40 #include <inttypes.h>
41 +#include <sys/sysinfo.h>
42 +#define _LINUX_SYSINFO_H /* avoid collision with musl header */
43 #include <linux/genetlink.h>
44 #include <linux/devlink.h>
45 #include <libmnl/libmnl.h>
46 #include <netinet/ether.h>
47 -#include <sys/sysinfo.h>
48 #include <sys/queue.h>
49
50 #include "SNAPSHOT.h"