[PATCH] netfilter: resolve compilation error in userspace when using ip_tables.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux