mirror of
https://github.com/coolsnowwolf/luci
synced 2025-01-08 11:27:28 +08:00
luci-app-turboacc: improve mtkhnat
This commit is contained in:
parent
fbf4e87228
commit
dfe55b7989
@ -1,6 +1,6 @@
|
||||
# SPDX-Identifier-License: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2018 Lean <coolsnowwolf@gmail.com>
|
||||
# Copyright (C) 2022 Lean <coolsnowwolf@gmail.com>
|
||||
# Copyright (C) 2019-2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
@ -10,7 +10,7 @@ s = m:section(TypedSection, "turboacc", "")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
if nixio.fs.access("/lib/modules/" .. kernel_version .. "/xt_FLOWOFFLOAD.ko") then
|
||||
if nixio.fs.access("/lib/modules/" .. kernel_version .. "/xt_FLOWOFFLOAD.ko") and not nixio.fs.access("/lib/modules/" .. kernel_version .. "/mtkhnat.ko") then
|
||||
sw_flow = s:option(Flag, "sw_flow", translate("Software flow offloading"))
|
||||
sw_flow.default = 0
|
||||
sw_flow.description = translate("Software based offloading for routing/NAT")
|
||||
@ -21,7 +21,7 @@ sw_flow:depends("sfe_flow", 0)
|
||||
end
|
||||
end
|
||||
|
||||
if luci.sys.call("cat /etc/openwrt_release | grep -q mt762") == 0 then
|
||||
if luci.sys.call("cat /etc/openwrt_release | grep -q mt762") == 0 and not nixio.fs.access("/lib/modules/" .. kernel_version .. "/mtkhnat.ko") then
|
||||
hw_flow = s:option(Flag, "hw_flow", translate("Hardware flow offloading"))
|
||||
hw_flow.default = 0
|
||||
hw_flow.description = translate("Requires hardware NAT support. Implemented at least for mt762x")
|
||||
|
@ -7,4 +7,7 @@ uci -q batch <<-EOF >/dev/null
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
[ -n "$(lsmod | grep mtkhnat)" ] && uci set turboacc.config.sw_flow='0' && uci set turboacc.config.hw_flow='0'
|
||||
uci commit turboacc
|
||||
|
||||
exit 0
|
||||
|
@ -4117,3 +4117,7 @@ msgstr "已标记"
|
||||
|
||||
msgid "untagged"
|
||||
msgstr "未标记"
|
||||
|
||||
msgid "Logo"
|
||||
msgstr "图标"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user