natflow: remove log printing
Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
parent
a1fc054667
commit
f39de79ceb
@ -3,5 +3,4 @@
|
|||||||
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
|
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
|
||||||
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0
|
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0
|
||||||
|
|
||||||
logger -t natflow "reloading natflow due to $ACTION of $INTERFACE ($DEVICE)"
|
|
||||||
/etc/init.d/natflow restart &
|
/etc/init.d/natflow restart &
|
||||||
|
@ -5,27 +5,15 @@ 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" | grep -q "generic-receive-offload: off" || ethtool -K "$eth" gro off
|
||||||
ethtool -K "$eth" gro off
|
ethtool -k "$eth" | grep -q "generic-segmentation-offload: off" || ethtool -K "$eth" gso off
|
||||||
logger -t natflow "disable gro for <$eth>"
|
|
||||||
}
|
|
||||||
ethtool -k "$eth" | grep -q "generic-segmentation-offload: off" || {
|
|
||||||
ethtool -K "$eth" gso off
|
|
||||||
logger -t natflow "disable gso for <$eth>"
|
|
||||||
}
|
|
||||||
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
|
||||||
ethtool -k "$eth" | grep -q "generic-receive-offload: on" || {
|
[[ "$(uname -m)" != arm* ]] && ethtool -k "$eth" | grep -q "generic-receive-offload: on" || ethtool -K "$eth" gro on
|
||||||
ethtool -K "$eth" gro on
|
ethtool -k "$eth" | grep -q "generic-segmentation-offload: on" || ethtool -K "$eth" gso on
|
||||||
logger -t natflow "enable gro for <$eth>"
|
|
||||||
}
|
|
||||||
ethtool -k "$eth" | grep -q "generic-segmentation-offload: on" || {
|
|
||||||
ethtool -K "$eth" gso on
|
|
||||||
logger -t natflow "enable gro for <$eth>"
|
|
||||||
}
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,16 +25,17 @@ start() {
|
|||||||
echo disabled=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 ifname_clear >/dev/natflow_ctl
|
echo ifname_clear >/dev/natflow_ctl
|
||||||
|
logger -t natflow "natflow has been enabled"
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
test -c /dev/natflow_ctl || return 0
|
test -c /dev/natflow_ctl || return 0
|
||||||
enable_gro_gso
|
enable_gro_gso
|
||||||
echo disabled=1 >/dev/natflow_ctl
|
echo disabled=1 >/dev/natflow_ctl
|
||||||
|
logger -t natflow "natflow has been disabled"
|
||||||
}
|
}
|
||||||
|
|
||||||
restart() {
|
restart() {
|
||||||
stop
|
stop
|
||||||
sleep 1
|
|
||||||
start
|
start
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user