netfilter, iptables: add optional CHECKSUM module
authorDenis Osvald <denis.osvald@sartura.hr>
Sun, 22 Oct 2017 20:21:23 +0000 (22:21 +0200)
committerJohn Crispin <john@phrozen.org>
Mon, 6 Nov 2017 15:39:41 +0000 (16:39 +0100)
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
include/netfilter.mk
package/kernel/linux/modules/netfilter.mk
package/network/utils/iptables/Makefile

index 1f5050b0c3424b4054bf55b95ad43b0bf27d9496..616425cb089592d8e8e2a6d81a7b39dc11951693 100644 (file)
@@ -262,6 +262,10 @@ $(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_i
 
 $(eval $(call nf_add,IPT_U32,CONFIG_NETFILTER_XT_MATCH_U32, $(P_XT)xt_u32))
 
+# checksum
+
+$(eval $(call nf_add,IPT_CHECKSUM,CONFIG_NETFILTER_XT_TARGET_CHECKSUM, $(P_XT)xt_CHECKSUM))
+
 
 # netlink
 
index 0ad6987aa672d4265582e710f9faaa9492568599..0d817ed7f4eb73dd211fce29506e0d867e763d5c 100644 (file)
@@ -529,6 +529,23 @@ endef
 
 $(eval $(call KernelPackage,ipt-u32))
 
+define KernelPackage/ipt-checksum
+  TITLE:=CHECKSUM support
+  KCONFIG:= \
+       CONFIG_NETFILTER_XT_TARGET_CHECKSUM
+  FILES:= \
+       $(LINUX_DIR)/net/netfilter/xt_CHECKSUM.ko \
+       $(foreach mod,$(IPT_CHECKSUM-m),$(LINUX_DIR)/net/$(mod).ko)
+  AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CHECKSUM-m)))
+  $(call AddDepends/ipt)
+endef
+
+define KernelPackage/ipt-checksum/description
+  Kernel modules for CHECKSUM fillin target
+endef
+
+$(eval $(call KernelPackage,ipt-checksum))
+
 
 define KernelPackage/ipt-iprange
   TITLE:=Module for matching ip ranges
index 133d98c16bb2be7a1862822c5ea9b71044ca1b87..43b5220f2d32958030ab8634136200eab65b88a2 100644 (file)
@@ -395,6 +395,15 @@ U32 iptables extensions.
 
 endef
 
+define Package/iptables-mod-checksum
+$(call Package/iptables/Module, +kmod-ipt-checksum)
+  TITLE:=IP CHECKSUM target extension
+endef
+
+define Package/iptables-mod-checksum/description
+iptables extension for the CHECKSUM calculation target
+endef
+
 define Package/ip6tables
 $(call Package/iptables/Default)
   DEPENDS:=@IPV6 +kmod-ip6tables +iptables
@@ -600,6 +609,7 @@ $(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m)))
 $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m)))
 $(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m)))
 $(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m)))
+$(eval $(call BuildPlugin,iptables-mod-checksum,$(IPT_CHECKSUM-m)))
 $(eval $(call BuildPackage,ip6tables))
 $(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m)))
 $(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m)))