Fix iptables abuse of kernel header files. Use exported headers instead.
authorGabor Juhos <juhosg@openwrt.org>
Thu, 3 May 2012 09:43:10 +0000 (09:43 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Thu, 3 May 2012 09:43:10 +0000 (09:43 +0000)
[juhosg: export xt_layer7.h for all kernel versions]

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
SVN-Revision: 31566

include/kernel-defaults.mk
package/iptables/Makefile
target/linux/generic/patches-2.6.32/100-netfilter_layer7_2.21.patch
target/linux/generic/patches-2.6.37/600-netfilter_layer7_2.22.patch
target/linux/generic/patches-2.6.38/600-netfilter_layer7_2.22.patch
target/linux/generic/patches-2.6.39/600-netfilter_layer7_2.22.patch
target/linux/generic/patches-3.0/600-netfilter_layer7_2.22.patch
target/linux/generic/patches-3.1/600-netfilter_layer7_2.22.patch
target/linux/generic/patches-3.2/600-netfilter_layer7_2.22.patch
target/linux/generic/patches-3.3/600-netfilter_layer7_2.22.patch

index 0c188502fccb3c509fdac35f480e45b4c1b588ec..f55ea8a8448c34f57e891651384a2685573420c2 100644 (file)
@@ -106,6 +106,7 @@ define Kernel/Configure/Default
        $(call Kernel/SetInitramfs)
        -$(_SINGLE)$(MAKE) $(KERNEL_MAKEOPTS) oldconfig prepare scripts
        rm -rf $(KERNEL_BUILD_DIR)/modules
+       $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
        $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagic
 endef
 
index 026df266ba14abaf2a31fbb6b22d524d007ea6fe..ff7d4282156979650c1c7b73e9b04ee31f142f35 100644 (file)
@@ -343,26 +343,26 @@ endef
 
 TARGET_CPPFLAGS := \
        -I$(PKG_BUILD_DIR)/include \
-       -I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include \
+       -I$(LINUX_DIR)/user_headers/include \
        $(TARGET_CPPFLAGS)
 
 TARGET_CFLAGS += \
        -I$(PKG_BUILD_DIR)/include \
-       -I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include
+       -I$(LINUX_DIR)/user_headers/include
 
 CONFIGURE_ARGS += \
        --enable-shared \
        --enable-devel \
        $(if $(CONFIG_IPV6),--enable-ipv6,--disable-ipv6) \
        --enable-libipq \
-       --with-kernel="$(LINUX_DIR)" \
+       --with-kernel="$(LINUX_DIR)/user_headers" \
        --with-xtlibdir=/usr/lib/iptables \
        --enable-static
 
 MAKE_FLAGS := \
        $(TARGET_CONFIGURE_OPTS) \
        COPT_FLAGS="$(TARGET_CFLAGS)" \
-       KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
+       KERNEL_DIR="$(LINUX_DIR)/user_headers/" PREFIX=/usr \
        KBUILD_OUTPUT="$(LINUX_DIR)" \
        BUILTIN_MODULES="$(patsubst ipt_%,%,$(patsubst xt_%,%,$(IPT_BUILTIN) $(IPT_CONNTRACK-m) $(IPT_NAT-m)))"
 
index de9c63c357abafaea08a9faaf4e825c76314a722..00b6d480be347d3951e84562894a74fb5e6c489e 100644 (file)
 +
 +module_init(xt_layer7_init);
 +module_exit(xt_layer7_fini);
+--- a/include/linux/netfilter/Kbuild
++++ b/include/linux/netfilter/Kbuild
+@@ -45,6 +45,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h
index 8a66cab18ef9e05bc7bc957e7f51262e637dd225..a32169d49f8420e21e81e984c2873f2e07d0e98c 100644 (file)
 +};
 +
 +#endif /* _XT_LAYER7_H */
+--- a/include/linux/netfilter/Kbuild
++++ b/include/linux/netfilter/Kbuild
+@@ -40,6 +40,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h
index 8a66cab18ef9e05bc7bc957e7f51262e637dd225..a32169d49f8420e21e81e984c2873f2e07d0e98c 100644 (file)
 +};
 +
 +#endif /* _XT_LAYER7_H */
+--- a/include/linux/netfilter/Kbuild
++++ b/include/linux/netfilter/Kbuild
+@@ -40,6 +40,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h
index 87c2e1fc2e6d8522b45cb090d6aa90af38eeee31..4df080c3d01445e1043fd864f04a1ef05142851a 100644 (file)
 +};
 +
 +#endif /* _XT_LAYER7_H */
+--- a/include/linux/netfilter/Kbuild
++++ b/include/linux/netfilter/Kbuild
+@@ -45,6 +45,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h
index 389152b4dc049b6dc663f209c8f55d00a1a3b919..8d2bce2d42d12db3ef0f9b50a1f82e20dfa57700 100644 (file)
 +};
 +
 +#endif /* _XT_LAYER7_H */
+--- a/include/linux/netfilter/Kbuild
++++ b/include/linux/netfilter/Kbuild
+@@ -45,6 +45,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h
index 389152b4dc049b6dc663f209c8f55d00a1a3b919..8d2bce2d42d12db3ef0f9b50a1f82e20dfa57700 100644 (file)
 +};
 +
 +#endif /* _XT_LAYER7_H */
+--- a/include/linux/netfilter/Kbuild
++++ b/include/linux/netfilter/Kbuild
+@@ -45,6 +45,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h
index d62eb3757237b18d630b45043b9bafe5c0f5a86d..b3d6bca0f0b0910f7d58b463f3bec4410733a5b9 100644 (file)
 +};
 +
 +#endif /* _XT_LAYER7_H */
+--- a/include/linux/netfilter/Kbuild
++++ b/include/linux/netfilter/Kbuild
+@@ -45,6 +45,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h
index fe74ae7f511d61a5f47bdc34720a30d786b6922a..f3055590abb6d8fd2528c1ae31dec5a25009433b 100644 (file)
 +};
 +
 +#endif /* _XT_LAYER7_H */
+--- a/include/linux/netfilter/Kbuild
++++ b/include/linux/netfilter/Kbuild
+@@ -49,6 +49,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h