natflow: fix typo

Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
sbwml 2024-09-04 11:04:41 +08:00
parent 5d63a4c98d
commit 355bbd7ccf

View File

@ -4,14 +4,14 @@
START=95 START=95
disable_gro_gso() { disable_gro_gso() {
for eth in $(ifconfig | grep "^eth\|^dsa|^lan|^wan" | awk '{print $1}' | sort | uniq); do for eth in $(ifconfig | grep "^eth\|^dsa\|^lan\|^wan" | awk '{print $1}' | sort | uniq); do
ethtool -k "$eth" | grep -q "generic-receive-offload: off" || ethtool -K "$eth" gro off ethtool -k "$eth" | grep -q "generic-receive-offload: off" || ethtool -K "$eth" gro off
ethtool -k "$eth" | grep -q "generic-segmentation-offload: off" || ethtool -K "$eth" gso off ethtool -k "$eth" | grep -q "generic-segmentation-offload: off" || ethtool -K "$eth" gso off
done done
} }
enable_gro_gso() { enable_gro_gso() {
for eth in $(ifconfig | grep "^eth\|^dsa|^lan|^wan" | awk '{print $1}' | sort | uniq); do for eth in $(ifconfig | grep "^eth\|^dsa\|^lan\|^wan" | awk '{print $1}' | sort | uniq); do
[[ "$(uname -m)" != arm* ]] && ethtool -k "$eth" | grep -q "generic-receive-offload: on" || ethtool -K "$eth" gro on [[ "$(uname -m)" != arm* ]] && ethtool -k "$eth" | grep -q "generic-receive-offload: on" || ethtool -K "$eth" gro on
ethtool -k "$eth" | grep -q "generic-segmentation-offload: on" || ethtool -K "$eth" gso on ethtool -k "$eth" | grep -q "generic-segmentation-offload: on" || ethtool -K "$eth" gso on
done done
@ -22,8 +22,11 @@ start() {
[ "$(uci -q get firewall.@defaults[0].natflow)" != 1 ] && return 0 [ "$(uci -q get firewall.@defaults[0].natflow)" != 1 ] && return 0
disable_gro_gso disable_gro_gso
delay_pkts=$(uci -q get firewall.@defaults[0].natflow_delay_pkts || echo 0) delay_pkts=$(uci -q get firewall.@defaults[0].natflow_delay_pkts || echo 0)
echo disabled=0 >/dev/natflow_ctl
echo "debug=0" >/dev/natflow_ctl
echo "disabled=0" >/dev/natflow_ctl
echo "delay_pkts=$delay_pkts" >/dev/natflow_ctl echo "delay_pkts=$delay_pkts" >/dev/natflow_ctl
echo "skip_qos_to_slow_path=0" >/dev/natflow_ctl
echo ifname_clear >/dev/natflow_ctl echo ifname_clear >/dev/natflow_ctl
logger -t natflow "natflow has been enabled" logger -t natflow "natflow has been enabled"
} }