From: Jan Engelhardt <jengelh@inai.de>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, mikko.rapeli@iki.fi,
normand@linux.vnet.ibm.com
Subject: [PATCH] netfilter: resolve compilation error in userspace when using ip_tables.h
Date: Fri, 22 Apr 2016 16:04:30 +0200 [thread overview]
Message-ID: <1461333870-17030-1-git-send-email-jengelh@inai.de> (raw)
In-Reply-To: <alpine.LSU.2.20.1604221535250.14824@nerf40.vanv.qr>
Compilation of iptables plugins which include these two lines
#include <xtables.h>
#include <linux/netfilter_ipv4/ip_tables.h>
fails since commit 1ffad83dffd675cd742286ae82dca7d746cb0da8, because
the userspace parts almost everywhere include <net/if.h>, which
collides with <linux/if.h>.
Use the __KERNEL__ trick that was last present in
d16cf20e2f2f13411eece7f7fb72c17d141c4a84^:include/linux/netfilter_ipv4/ip_queue.h
to resolve this.
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
include/uapi/linux/netfilter_ipv4/ip_tables.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/netfilter_ipv4/ip_tables.h b/include/uapi/linux/netfilter_ipv4/ip_tables.h
index d0da53d..784a4b7 100644
--- a/include/uapi/linux/netfilter_ipv4/ip_tables.h
+++ b/include/uapi/linux/netfilter_ipv4/ip_tables.h
@@ -17,7 +17,11 @@
#include <linux/types.h>
#include <linux/compiler.h>
-#include <linux/if.h>
+#ifdef __KERNEL__
+# include <linux/if.h>
+#else
+# include <net/if.h>
+#endif
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter/x_tables.h>
--
2.6.6
next prev parent reply other threads:[~2016-04-22 14:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 10:49 xtables-addons build failed with linux 4.5 header Normand
2016-04-22 13:46 ` Jan Engelhardt
2016-04-22 14:04 ` Jan Engelhardt [this message]
2016-04-24 16:38 ` [PATCH] netfilter: resolve compilation error in userspace when using ip_tables.h Mikko Rapeli
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=1461333870-17030-1-git-send-email-jengelh@inai.de \
--to=jengelh@inai.de \
--cc=mikko.rapeli@iki.fi \
--cc=netfilter-devel@vger.kernel.org \
--cc=normand@linux.vnet.ibm.com \
--cc=pablo@netfilter.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).