0003-include-fix-build-with-kernel-headers-before-4.2.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 8d9d7e4b9ef4c6e6abab2cf35c747d7ca36824bd Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <baruch@tkos.co.il>
  3. Date: Fri, 16 Nov 2018 09:30:33 +0200
  4. Subject: [PATCH] include: fix build with kernel headers before 4.2
  5. Commit 672accf1530 (include: update kernel netfilter header files)
  6. updated linux/netfilter.h and brought with it the update from kernel
  7. commit a263653ed798 (netfilter: don't pull include/linux/netfilter.h
  8. from netns headers). This triggers conflict of headers that is fixed in
  9. kernel commit 279c6c7fa64f (api: fix compatibility of linux/in.h with
  10. netinet/in.h) included in kernel version 4.2. For earlier kernel headers
  11. we need a workaround that prevents the headers conflict.
  12. Fixes the following build failure:
  13. In file included from .../sysroot/usr/include/netinet/ip.h:25:0,
  14. from ../include/libiptc/ipt_kernel_headers.h:8,
  15. from ../include/libiptc/libiptc.h:6,
  16. from libip4tc.c:29:
  17. .../sysroot/usr/include/linux/in.h:26:3: error: redeclaration of enumerator ‘IPPROTO_IP’
  18. IPPROTO_IP = 0, /* Dummy protocol for TCP */
  19. ^
  20. .../sysroot/usr/include/netinet/in.h:33:5: note: previous definition of ‘IPPROTO_IP’ was here
  21. IPPROTO_IP = 0, /* Dummy protocol for TCP. */
  22. ^~~~~~~~~~
  23. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  24. Signed-off-by: Florian Westphal <fw@strlen.de>
  25. ---
  26. Upstream status: commit 8d9d7e4b9ef4c6
  27. include/linux/netfilter.h | 2 ++
  28. 1 file changed, 2 insertions(+)
  29. diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
  30. index c3f087ac680c..bacf8cd92116 100644
  31. --- a/include/linux/netfilter.h
  32. +++ b/include/linux/netfilter.h
  33. @@ -3,7 +3,9 @@
  34. #include <linux/types.h>
  35. +#ifndef _NETINET_IN_H
  36. #include <linux/in.h>
  37. +#endif
  38. #include <linux/in6.h>
  39. #include <limits.h>
  40. --
  41. 2.19.1