0001-conntrack-fix-build-with-kernel-5-15-and-musl.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From 21ee35dde73aec5eba35290587d479218c6dd824 Mon Sep 17 00:00:00 2001
  2. From: Robert Marko <robimarko@gmail.com>
  3. Date: Thu, 24 Feb 2022 15:01:11 +0100
  4. Subject: conntrack: fix build with kernel 5.15 and musl
  5. Currently, with kernel 5.15 headers and musl building is failing with
  6. redefinition errors due to a conflict between the kernel and musl headers.
  7. Musl is able to suppres the conflicting kernel header definitions if they
  8. are included after the standard libc ones, however since ICMP definitions
  9. were moved into a separate internal header to avoid duplication this has
  10. stopped working and is breaking the builds.
  11. It seems that the issue is that <netinet/in.h> which contains the UAPI
  12. suppression defines is included in the internal.h header and not in the
  13. proto.h which actually includes the kernel ICMP headers and thus UAPI
  14. supression defines are not present.
  15. Solve this by moving the <netinet/in.h> include before the ICMP kernel
  16. includes in the proto.h
  17. Fixes: bc1cb4b11403 ("conntrack: Move icmp request>reply type mapping to common file")
  18. Signed-off-by: Robert Marko <robimarko@gmail.com>
  19. Signed-off-by: Florian Westphal <fw@strlen.de>
  20. [Retrieved from:
  21. https://git.netfilter.org/libnetfilter_conntrack/commit/?id=21ee35dde73aec5eba35290587d479218c6dd824]
  22. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  23. ---
  24. include/internal/internal.h | 1 -
  25. include/internal/proto.h | 1 +
  26. 2 files changed, 1 insertion(+), 1 deletion(-)
  27. diff --git a/include/internal/internal.h b/include/internal/internal.h
  28. index 2ef8a90..7cd7c44 100644
  29. --- a/include/internal/internal.h
  30. +++ b/include/internal/internal.h
  31. @@ -14,7 +14,6 @@
  32. #include <arpa/inet.h>
  33. #include <time.h>
  34. #include <errno.h>
  35. -#include <netinet/in.h>
  36. #include <libnfnetlink/libnfnetlink.h>
  37. #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
  38. diff --git a/include/internal/proto.h b/include/internal/proto.h
  39. index 40e7bfe..60a5f4e 100644
  40. --- a/include/internal/proto.h
  41. +++ b/include/internal/proto.h
  42. @@ -2,6 +2,7 @@
  43. #define _NFCT_PROTO_H_
  44. #include <stdint.h>
  45. +#include <netinet/in.h>
  46. #include <linux/icmp.h>
  47. #include <linux/icmpv6.h>
  48. --
  49. cgit v1.2.3