]> git.proxmox.com Git - mirror_iproute2.git/commit
devlink: fix libc and kernel headers collision
authorBaruch Siach <baruch@tkos.co.il>
Thu, 27 Jun 2019 18:37:19 +0000 (21:37 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 28 Jun 2019 22:20:00 +0000 (15:20 -0700)
commitd0272f5404773a60cbc17c2277affdbbf8d99c67
treebe0fa41ae1bc345c92c056e81e494c703366a125
parentee09370a7206ad361653e437ca6429533a1c02a9
devlink: fix libc and kernel headers collision

Since commit 2f1242efe9d ("devlink: Add devlink health show command") we
use the sys/sysinfo.h header for the sysinfo(2) system call. But since
iproute2 carries a local version of the kernel struct sysinfo, this
causes a collision with libc that do not rely on kernel defined sysinfo
like musl libc:

In file included from devlink.c:25:0:
.../sysroot/usr/include/sys/sysinfo.h:10:8: error: redefinition of 'struct sysinfo'
 struct sysinfo {
        ^~~~~~~
In file included from ../include/uapi/linux/kernel.h:5:0,
                 from ../include/uapi/linux/netlink.h:5,
                 from ../include/uapi/linux/genetlink.h:6,
                 from devlink.c:21:
../include/uapi/linux/sysinfo.h:8:8: note: originally defined here
 struct sysinfo {
        ^~~~~~~

Move the sys/sysinfo.h userspace header before kernel headers, and
suppress the indirect include of linux/sysinfo.h.

Cc: Aya Levin <ayal@mellanox.com>
Cc: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
devlink/devlink.c