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