diff --git a/package/mtk/applications/luci-app-turboacc-mtk/htdocs/luci-static/resources/view/turboacc.js b/package/mtk/applications/luci-app-turboacc-mtk/htdocs/luci-static/resources/view/turboacc.js index 971405ffda..c8b948c9ed 100644 --- a/package/mtk/applications/luci-app-turboacc-mtk/htdocs/luci-static/resources/view/turboacc.js +++ b/package/mtk/applications/luci-app-turboacc-mtk/htdocs/luci-static/resources/view/turboacc.js @@ -176,14 +176,15 @@ return view.extend({ o = s.option(form.Flag, 'fastpath_mh_eth_hnat_macvlan', _('Enable ethernet HNAT for MACVLAN WAN device'), _('Enable hardware offloading for macvlan (sing wan only).')); - o.default = o.enabled; + o.default = o.disabled; o.rmempty = false; o.depends('fastpath_mh_eth_hnat', '1'); o = s.option(form.Value, 'fastpath_mh_eth_hnat_bind_rate', _('HNAT bind rate threshold (pps)'), _('The smaller the threshold, the easier it is for the connection to be accelerated.')); - o.datatype = 'and(uinteger,min(1))'; - o.rmempty = false; + o.optional = true; + o.datatype = 'range(1,30)'; + o.placeholder = 30; o.depends('fastpath_mh_eth_hnat', '1'); o = s.option(form.ListValue, 'fullcone', _('Full cone NAT'), diff --git a/package/mtk/applications/luci-app-turboacc-mtk/root/etc/init.d/turboacc b/package/mtk/applications/luci-app-turboacc-mtk/root/etc/init.d/turboacc index 60623b58cf..287e86a261 100755 --- a/package/mtk/applications/luci-app-turboacc-mtk/root/etc/init.d/turboacc +++ b/package/mtk/applications/luci-app-turboacc-mtk/root/etc/init.d/turboacc @@ -43,21 +43,23 @@ start() { lsmod |grep -q "shortcut_fe_cm" || modprobe "shortcut_fe_cm" 2>"/dev/null" ;; "mediatek_hnat") - local fastpath_mh_eth_hnat fastpath_mh_eth_hnat_v6 fastpath_mh_eth_hnat_macvlan - config_get_bool fastpath_mh_eth_hnat "config" "fastpath_mh_eth_hnat" "1" + local fastpath_mh_eth_hnat local hnat_path="/sys/kernel/debug/hnat" + + config_get_bool "fastpath_mh_eth_hnat" "config" "fastpath_mh_eth_hnat" "1" echo "$fastpath_mh_eth_hnat" > "$hnat_path/hook_toggle" + if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then - config_get_bool fastpath_mh_eth_hnat_v6 "config" "fastpath_mh_eth_hnat_v6" "1" + local fastpath_mh_eth_hnat_v6 fastpath_mh_eth_hnat_macvlan fastpath_mh_eth_hnat_bind_rate + + config_get_bool "fastpath_mh_eth_hnat_v6" "config" "fastpath_mh_eth_hnat_v6" "1" echo "8 $fastpath_mh_eth_hnat_v6" > "$hnat_path/hnat_setting" - fi - if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then - config_get_bool fastpath_mh_eth_hnat_macvlan "config" "fastpath_mh_eth_hnat_macvlan" "1" - echo "12 $fastpath_mh_eth_hnat_macvlan" > "$hnat_path/hnat_setting" - fi - if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then - config_get fastpath_mh_eth_hnat_bind_rate "config" "fastpath_mh_eth_hnat_bind_rate" + + config_get "fastpath_mh_eth_hnat_bind_rate" "config" "fastpath_mh_eth_hnat_bind_rate" "30" echo "11 $fastpath_mh_eth_hnat_bind_rate" > "$hnat_path/hnat_setting" + + config_get_bool "fastpath_mh_eth_hnat_macvlan" "config" "fastpath_mh_eth_hnat_macvlan" "0" + echo "12 $fastpath_mh_eth_hnat_macvlan" > "$hnat_path/hnat_setting" fi ;; esac