linux/include/uapi
Hauke Mehrtens da360299b6 uapi/if_ether.h: move __UAPI_DEF_ETHHDR libc define
This fixes a compile problem of some user space applications by not
including linux/libc-compat.h in uapi/if_ether.h.

linux/libc-compat.h checks which "features" the header files, included
from the libc, provide to make the Linux kernel uapi header files only
provide no conflicting structures and enums. If a user application mixes
kernel headers and libc headers it could happen that linux/libc-compat.h
gets included too early where not all other libc headers are included
yet. Then the linux/libc-compat.h would not prevent all the
redefinitions and we run into compile problems.
This patch removes the include of linux/libc-compat.h from
uapi/if_ether.h to fix the recently introduced case, but not all as this
is more or less impossible.

It is no problem to do the check directly in the if_ether.h file and not
in libc-compat.h as this does not need any fancy glibc header detection
as glibc never provided struct ethhdr and should define
__UAPI_DEF_ETHHDR by them self when they will provide this.

The following test program did not compile correctly any more:

#include <linux/if_ether.h>
#include <netinet/in.h>
#include <linux/in.h>

int main(void)
{
	return 0;
}

Fixes: 6926e041a8 ("uapi/if_ether.h: prevent redefinition of struct ethhdr")
Reported-by: Guillaume Nault <g.nault@alphalink.fr>
Cc: <stable@vger.kernel.org> # 4.15
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-13 11:23:24 -05:00
..
asm-generic unify {de,}mangle_poll(), get rid of kernel-side POLL... 2018-02-11 14:37:22 -08:00
drm drm/tegra: Changes for v4.16-rc1 2018-01-12 11:46:19 +10:00
linux uapi/if_ether.h: move __UAPI_DEF_ETHHDR libc define 2018-02-13 11:23:24 -05:00
misc ocxl: Add AFU interrupt support 2018-01-24 11:42:58 +11:00
mtd License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
rdma RDMA/netlink: Hide unimplemented NLDEV commands 2018-01-31 16:30:04 -05:00
scsi License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
sound Merge remote-tracking branches 'asoc/topic/fsl', 'asoc/topic/fsl-ssi', 'asoc/topic/fsl_asrc' and 'asoc/topic/hdac_hdmi' into asoc-next 2018-01-18 11:55:56 +00:00
video License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
xen License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00