Skip to content

Commit

Permalink
default enable fullconenat in fw3
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Sep 22, 2018
1 parent 1d9f109 commit 0f4c3eb
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 182 deletions.
2 changes: 1 addition & 1 deletion include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw km
default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
luci-app-filetransfer luci-app-ssr-pro luci-app-usb-printer luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \
luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol \
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-fullconenat
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon
# For nas targets
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
# For router targets
Expand Down
14 changes: 0 additions & 14 deletions package/lean/luci-app-fullconenat/Makefile

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions package/lean/luci-app-fullconenat/luasrc/model/cbi/fullconenat.lua

This file was deleted.

35 changes: 0 additions & 35 deletions package/lean/luci-app-fullconenat/po/zh-cn/fullconenat.po

This file was deleted.

5 changes: 0 additions & 5 deletions package/lean/luci-app-fullconenat/root/etc/config/fullconenat

This file was deleted.

69 changes: 0 additions & 69 deletions package/lean/luci-app-fullconenat/root/etc/init.d/fullconenat

This file was deleted.

This file was deleted.

12 changes: 11 additions & 1 deletion package/network/config/firewall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,19 @@ define Package/firewall
SECTION:=net
CATEGORY:=Base system
TITLE:=OpenWrt C Firewall
DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +kmod-ipt-nat
DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +kmod-ipt-nat +PACKAGE_firewall-FULLCONENAT:iptables-mod-fullconenat
endef

define Package/firewall/config
if PACKAGE_firewall
config PACKAGE_firewall-FULLCONENAT
bool "Use FULLCONENAT"
default y
endif
endef

TARGET_CFLAGS += $(if $(CONFIG_PACKAGE_firewall-FULLCONENAT),-DUSE_FULLCONENAT,)

define Package/firewall/description
This package provides a config-compatible C implementation of the UCI firewall.
endef
Expand Down
23 changes: 23 additions & 0 deletions package/network/config/firewall/patches/fullconenat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/zones.c b/zones.c
index 505ab20..44500d5 100644
--- a/zones.c
+++ b/zones.c
@@ -708,8 +708,18 @@ print_zone_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
{
r = fw3_ipt_rule_new(handle);
fw3_ipt_rule_src_dest(r, msrc, mdest);
+#ifdef USE_FULLCONENAT
+ fw3_ipt_rule_target(r, "FULLCONENAT");
+#else
fw3_ipt_rule_target(r, "MASQUERADE");
+#endif
fw3_ipt_rule_append(r, "zone_%s_postrouting", zone->name);
+#ifdef USE_FULLCONENAT
+ r = fw3_ipt_rule_new(handle);
+ fw3_ipt_rule_src_dest(r, msrc, mdest);
+ fw3_ipt_rule_target(r, "FULLCONENAT");
+ fw3_ipt_rule_append(r, "zone_%s_prerouting", zone->name);
+#endif
}
}
}

0 comments on commit 0f4c3eb

Please sign in to comment.