| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- --- a/package/feeds/custom/luci-app-turboacc/luasrc/controller/turboacc.lua
- +++ b/package/feeds/custom/luci-app-turboacc/luasrc/controller/turboacc.lua
- @@ -14,7 +14,7 @@ function index()
- end
-
- local function fastpath_status()
- - return luci.sys.call("{ [ -e /sys/module/xt_FLOWOFFLOAD/refcnt ] && [ x$(cat /sys/module/xt_FLOWOFFLOAD/refcnt 2>/dev/null) != x0 ]; } || lsmod | grep -q fast_classifier") == 0
- + return luci.sys.call("lsmod | grep -q natflow || lsmod | grep -q fast_classifier") == 0
- end
-
- local function bbr_status()
- --- a/package/feeds/custom/luci-app-turboacc/root/etc/init.d/turboacc
- +++ b/package/feeds/custom/luci-app-turboacc/root/etc/init.d/turboacc
- @@ -21,7 +21,7 @@ inital_conf(){
- config_get "dns_caching_v4_dns" "config" "dns_caching_v4_dns"
- config_get "dns_caching_v6_dns" "config" "dns_caching_v6_dns"
-
- - [ ! -e "/lib/modules/$(uname -r)/xt_FLOWOFFLOAD.ko" ] && { sw_flow="0"; hw_flow="0"; }
- + # [ ! -e "/lib/modules/$(uname -r)/xt_FLOWOFFLOAD.ko" ] && { sw_flow="0"; hw_flow="0"; }
- [ ! -e "/lib/modules/$(uname -r)/fast-classifier.ko" ] && { sfe_flow="0"; sfe_bridge="0"; sfe_ipv6="0"; }
- [ ! -e "/lib/modules/$(uname -r)/tcp_bbr.ko" ] && bbr_cca="0"
- [ ! -e "/lib/modules/$(uname -r)/xt_FULLCONENAT.ko" ] && fullcone_nat="0"
- @@ -213,11 +213,25 @@ revert_dns() {
- start(){
- inital_conf
-
- - uci set firewall.@defaults[0].flow_offloading="${sw_flow}"
- - uci set firewall.@defaults[0].flow_offloading_hw="${hw_flow}"
- uci set firewall.@defaults[0].fullcone="${fullcone_nat}"
- uci commit firewall
-
- + test -c /dev/natflow_ctl && {
- + enable_natflow="${sw_flow}"
- + enable_natflow_hw="${hw_flow}"
- + if [ "x${enable_natflow}" = "x1" ]; then
- + if [ "x`uci get firewall.@defaults[0].flow_offloading 2>/dev/null`" = "x1" ]; then
- + uci set firewall.@defaults[0].flow_offloading=0
- + uci set firewall.@defaults[0].flow_offloading_hw=0
- + uci commit firewall
- + /etc/init.d/firewall reload
- + fi
- + fi
- + echo debug=3 >/dev/natflow_ctl
- + echo disabled=$((!enable_natflow)) >/dev/natflow_ctl
- + echo hwnat=$((enable_natflow_hw)) >/dev/natflow_ctl
- + }
- +
- [ "${sw_flow}" -ne "1" ] && [ "${sfe_flow}" -eq "1" ] && {
- lsmod | grep -q fast_classifier || modprobe fast_classifier 2>"/dev/null"
- echo "${sfe_bridge}" > "/sys/fast_classifier/skip_to_bridge_ingress" 2>"/dev/null"
- @@ -264,11 +278,16 @@ start(){
- stop(){
- inital_conf
-
- - uci set firewall.@defaults[0].flow_offloading="${sw_flow}"
- - uci set firewall.@defaults[0].flow_offloading_hw="${hw_flow}"
- uci set firewall.@defaults[0].fullcone="${fullcone_nat}"
- uci commit firewall
-
- + test -c /dev/natflow_ctl && {
- + enable_natflow="${sw_flow}"
- + enable_natflow_hw="${hw_flow}"
- + echo disabled=$((!enable_natflow)) >/dev/natflow_ctl
- + echo hwnat=$((enable_natflow_hw)) >/dev/natflow_ctl
- + }
- +
- [ "${sfe_flow}" -ne "1" ] && {
- echo "0" > "/sys/fast_classifier/skip_to_bridge_ingress" 2>"/dev/null"
- rm -f "/dev/sfe_ipv6"
- --- a/package/feeds/custom/luci-app-turboacc/Makefile
- +++ b/package/feeds/custom/luci-app-turboacc/Makefile
- @@ -12,7 +12,7 @@
- PKG_LICENSE:=GPLv3.0+
-
- -LUCI_TITLE:=LuCI support for Flow Offload / Shortcut-FE
- +LUCI_TITLE:=LuCI support for Natflow / Shortcut-FE
- LUCI_DEPENDS:=+PACKAGE_$(PKG_NAME)_INCLUDE_shortcut-fe:kmod-fast-classifier \
- - +PACKAGE_$(PKG_NAME)_INCLUDE_flow-offload:kmod-ipt-offload \
- + +PACKAGE_$(PKG_NAME)_INCLUDE_natflow:kmod-natflow \
- +PACKAGE_$(PKG_NAME)_INCLUDE_bbr-cca:kmod-tcp-bbr \
- +PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder:dnsforwarder
- @@ -20,6 +20,6 @@
-
- define Package/$(PKG_NAME)/config
- -config PACKAGE_$(PKG_NAME)_INCLUDE_flow-offload
- - bool "Include Flow Offload"
- +config PACKAGE_$(PKG_NAME)_INCLUDE_natflow
- + bool "Include Natflow"
- depends on PACKAGE_$(PKG_NAME)_INCLUDE_shortcut-fe=n
- default y
- @@ -40,5 +40,5 @@
- PKG_CONFIG_DEPENDS:= \
- CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_shortcut-fe \
- - CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_flow-offload \
- + CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_natflow \
- CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_bbr-cca \
- CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder
- --- a/package/feeds/custom/luci-app-turboacc/po/zh_Hans/turboacc.po
- +++ b/package/feeds/custom/luci-app-turboacc/po/zh_Hans/turboacc.po
- @@ -11,16 +11,16 @@ msgid "Opensource Flow Offloading driver (Fast Path or Hardware NAT)"
- msgstr "开源流量分载驱动 (支持 Fast Path 或者 硬件 NAT)"
-
- msgid "Software flow offloading"
- -msgstr "软件流量分载"
- +msgstr "转发加速(natflow)"
-
- msgid "Software based offloading for routing/NAT"
- -msgstr "基于软件的 Routing/NAT 分载"
- +msgstr "使用转发加速(natflow)"
-
- msgid "Hardware flow offloading"
- -msgstr "硬件流量分载"
- +msgstr "硬件转发加速"
-
- msgid "Requires hardware NAT support. Implemented at least for mt76xx"
- -msgstr "需要硬件 NAT 支持。目前 mt76xx 已实现"
- +msgstr "使用硬件转发加速"
-
- msgid "Shortcut-FE flow offloading"
- msgstr "Shortcut-FE 流量分载"
- --- a/package/feeds/custom/natflow/Makefile
- +++ b/package/feeds/custom/natflow/Makefile
- @@ -51,17 +51,4 @@ define Build/Compile
- $(call Build/Compile/natflow)
- endef
-
- -define Package/natflow-boot
- - CATEGORY:=X
- - SUBMENU:=Fast Forward Stacks
- - TITLE:=natflow boot init script
- - DEPENDS:= +kmod-natflow
- -endef
- -
- -define Package/natflow-boot/install
- - $(INSTALL_DIR) $(1)/etc/init.d
- - $(INSTALL_BIN) ./files/natflow-boot.init $(1)/etc/init.d/natflow-boot
- -endef
- -
- $(eval $(call KernelPackage,natflow))
- -$(eval $(call BuildPackage,natflow-boot))
|