mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 02:51:50 +00:00
Fix metric and txqueuelen
This commit is contained in:
parent
701c0339de
commit
34caf3ee14
1 changed files with 29 additions and 11 deletions
|
@ -46,25 +46,39 @@ interface_macaddr_count() {
|
||||||
[ "$macaddr" = "$dmacaddr" ] && nbmac=$((nbmac+1))
|
[ "$macaddr" = "$dmacaddr" ] && nbmac=$((nbmac+1))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface_max_metric() {
|
||||||
|
local config="$1"
|
||||||
|
config_get metric "$config" metric
|
||||||
|
if [ "$metric" = "$count" ]; then
|
||||||
|
count=$((count+1))
|
||||||
|
config_set "$config" metric $count
|
||||||
|
fi
|
||||||
|
if [ "$metric" -gt "$count" ]; then
|
||||||
|
count=$metric
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
interface_multipath_settings() {
|
interface_multipath_settings() {
|
||||||
local mode iface proto
|
local mode iface proto metric
|
||||||
local config="$1"
|
local config="$1"
|
||||||
local intf="$2"
|
local intf="$2"
|
||||||
local enabled
|
local enabled
|
||||||
|
|
||||||
config_get enabled "$config" auto "1"
|
config_get enabled "$config" auto "1"
|
||||||
config_get iface "$config" ifname
|
config_get iface "$config" ifname
|
||||||
|
config_get txqueuelen "$config" txqueuelen
|
||||||
[ -z "$iface" ] && iface=$(ifstatus "$config" | jsonfilter -q -e '@["l3_device"]')
|
[ -z "$iface" ] && iface=$(ifstatus "$config" | jsonfilter -q -e '@["l3_device"]')
|
||||||
if [ "$(uci -q get openmptcprouter.${config}.metric)" = "" ]; then
|
if [ "$(uci -q get openmptcprouter.${config}.metric)" = "" ]; then
|
||||||
count=$(($count+1))
|
count=$((count+1))
|
||||||
|
metric=$count
|
||||||
else
|
else
|
||||||
count="$(uci -q get openmptcprouter.${config}.metric)"
|
metric="$(uci -q get openmptcprouter.${config}.metric)"
|
||||||
fi
|
fi
|
||||||
config_set "$config" metric $count
|
config_set "$config" metric $metric
|
||||||
uci -q set network.${config}.metric=$count
|
uci -q set network.${config}.metric=$metric
|
||||||
uci -q set openmptcprouter.${config}.metric=$count
|
uci -q set openmptcprouter.${config}.metric=$metric
|
||||||
config_get mode "$config" multipath
|
config_get mode "$config" multipath
|
||||||
id=$count
|
id=$metric
|
||||||
[ "$mode" = "" ] && {
|
[ "$mode" = "" ] && {
|
||||||
mode="$(uci -q get openmptcprouter.${config}.multipath)"
|
mode="$(uci -q get openmptcprouter.${config}.multipath)"
|
||||||
[ -n "$mode" ] && uci -q set network.${config}.multipath="$mode"
|
[ -n "$mode" ] && uci -q set network.${config}.multipath="$mode"
|
||||||
|
@ -221,11 +235,11 @@ interface_multipath_settings() {
|
||||||
#echo "ip route replace default via $gateway dev $iface"
|
#echo "ip route replace default via $gateway dev $iface"
|
||||||
ip route replace default via $gateway dev $iface
|
ip route replace default via $gateway dev $iface
|
||||||
}
|
}
|
||||||
[ "$mode" = "off" ] && {
|
if [ "$txqueuelen" != "" ]; then
|
||||||
ifconfig $iface txqueuelen 50 > /dev/null 2>&1
|
ifconfig $iface txqueuelen $txqueuelen > /dev/null 2>&1
|
||||||
} || {
|
else
|
||||||
ifconfig $iface txqueuelen 100 > /dev/null 2>&1
|
ifconfig $iface txqueuelen 100 > /dev/null 2>&1
|
||||||
}
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "1" ] && [ "$config" != "omr6in4" ]; then
|
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "1" ] && [ "$config" != "omr6in4" ]; then
|
||||||
# IPv6 Updates:
|
# IPv6 Updates:
|
||||||
|
@ -398,6 +412,10 @@ start_service() {
|
||||||
|
|
||||||
mptcpintf=""
|
mptcpintf=""
|
||||||
master=""
|
master=""
|
||||||
|
count="0"
|
||||||
|
config_load openmptcprouter
|
||||||
|
config_foreach interface_max_metric interface
|
||||||
|
|
||||||
config_load network
|
config_load network
|
||||||
#config_foreach remove route
|
#config_foreach remove route
|
||||||
#config_foreach remove route6
|
#config_foreach remove route6
|
||||||
|
|
Loading…
Reference in a new issue