Fix build with Linux kernel headers v4.15 #777
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linux kernel version 4.15 changed the libc/kernel headers suppression
logic in a way that introduces collisions:
In file included from ./../include/vrrp_ipaddress.h:32:0,
from ./../include/vrrp_arp.h:31,
from vrrp.c:29:
/home/peko/autobuild/instance-1/output/host/arc-buildroot-linux-uclibc/sysroot/usr/include/linux/in.h:29:3: error: redeclaration of enumerator 'IPPROTO_IP'
IPPROTO_IP = 0, /* Dummy protocol for TCP /
^
/home/peko/autobuild/instance-1/output/host/arc-buildroot-linux-uclibc/sysroot/usr/include/netinet/in.h:33:5: note: previous definition of 'IPPROTO_IP' was here
IPPROTO_IP = 0, / Dummy protocol for TCP. */
^~~~~~~~~~
Include the libc netinet/in.h header first to suppress the kernel
header.
In addition, add _GNU_SOURCE to vrrp.c for the libc provided in6_pktinfo
definition.
Signed-off-by: Baruch Siach baruch@tkos.co.il