netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Marko <robimarko@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: Robert Marko <robimarko@gmail.com>
Subject: [PATCH v2] conntrack: fix build with kernel 5.15 and musl
Date: Thu, 24 Feb 2022 15:01:11 +0100	[thread overview]
Message-ID: <20220224140111.2011488-1-robimarko@gmail.com> (raw)

Currently, with kernel 5.15 headers and musl building is failing with
redefinition errors due to a conflict between the kernel and musl headers.

Musl is able to suppres the conflicting kernel header definitions if they
are included after the standard libc ones, however since ICMP definitions
were moved into a separate internal header to avoid duplication this has
stopped working and is breaking the builds.

It seems that the issue is that <netinet/in.h> which contains the UAPI
suppression defines is included in the internal.h header and not in the
proto.h which actually includes the kernel ICMP headers and thus UAPI
supression defines are not present.

Solve this by moving the <netinet/in.h> include before the ICMP kernel
includes in the proto.h

Fixes: bc1cb4b11403 ("conntrack: Move icmp request>reply type mapping to common file")
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
Changes in v2:
* Add the forgoten fixes short hash
---
 include/internal/internal.h | 1 -
 include/internal/proto.h    | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/internal/internal.h b/include/internal/internal.h
index 2ef8a90..7cd7c44 100644
--- a/include/internal/internal.h
+++ b/include/internal/internal.h
@@ -14,7 +14,6 @@
 #include <arpa/inet.h>
 #include <time.h>
 #include <errno.h>
-#include <netinet/in.h>
 
 #include <libnfnetlink/libnfnetlink.h>
 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
diff --git a/include/internal/proto.h b/include/internal/proto.h
index 40e7bfe..60a5f4e 100644
--- a/include/internal/proto.h
+++ b/include/internal/proto.h
@@ -2,6 +2,7 @@
 #define _NFCT_PROTO_H_
 
 #include <stdint.h>
+#include <netinet/in.h>
 #include <linux/icmp.h>
 #include <linux/icmpv6.h>
 
-- 
2.35.1


             reply	other threads:[~2022-02-24 14:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 14:01 Robert Marko [this message]
2022-02-24 14:18 ` [PATCH v2] conntrack: fix build with kernel 5.15 and musl Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220224140111.2011488-1-robimarko@gmail.com \
    --to=robimarko@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).