mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
Fix metric attribution (#449)
This commit is contained in:
commit
cc839364bf
1 changed files with 8 additions and 8 deletions
|
@ -82,10 +82,6 @@ interface_max_metric() {
|
||||||
local config="$1"
|
local config="$1"
|
||||||
if [ "$1" != "omrvpn" ] && [ "$1" != "omr6in4" ] && [ "$1" != "lan" ]; then
|
if [ "$1" != "omrvpn" ] && [ "$1" != "omr6in4" ] && [ "$1" != "lan" ]; then
|
||||||
config_get metric "$config" metric
|
config_get metric "$config" metric
|
||||||
if [ "$metric" = "$count" ]; then
|
|
||||||
count=$((count+1))
|
|
||||||
config_set "$config" metric $count
|
|
||||||
fi
|
|
||||||
if [ "$metric" -gt "$count" ]; then
|
if [ "$metric" -gt "$count" ]; then
|
||||||
count=$metric
|
count=$metric
|
||||||
fi
|
fi
|
||||||
|
@ -119,15 +115,19 @@ interface_multipath_settings() {
|
||||||
[ -z "$iface" ] && config_get iface "$config" ifname
|
[ -z "$iface" ] && config_get iface "$config" ifname
|
||||||
config_get txqueuelen "$config" txqueuelen
|
config_get txqueuelen "$config" txqueuelen
|
||||||
[ -n "$(echo $iface | grep '@')" ] && iface=$(ifstatus "$config" | jsonfilter -q -e '@["device"]')
|
[ -n "$(echo $iface | grep '@')" ] && iface=$(ifstatus "$config" | jsonfilter -q -e '@["device"]')
|
||||||
if [ "$(uci -q get openmptcprouter.${config}.metric)" = "" ]; then
|
if [ "$(uci -q get openmptcprouter.${config}.metric)" = "" ] || [ "$(uci -q get openmptcprouter.${config}.metric)" = "1" ]; then
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
metric=$count
|
metric=$count
|
||||||
else
|
else
|
||||||
metric="$(uci -q get openmptcprouter.${config}.metric)"
|
metric="$(uci -q get openmptcprouter.${config}.metric)"
|
||||||
fi
|
fi
|
||||||
[ "$metric" -gt 1000 ] && metric=$((metric-1000))
|
[ "$metric" -gt 1000 ] && [ "${config}" != "omrvpn" ] && [ "${config}" != "omr6in4" ] && metric=$((metric-1000))
|
||||||
if [ "${config}" = "lan" ] || [ "$(uci -q get network.${config}.ip4table)" = "lan" ]; then
|
if [ "${config}" = "lan" ] || [ "$(uci -q get network.${config}.ip4table)" = "lan" ]; then
|
||||||
metric="9999"
|
metric="9999"
|
||||||
|
elif [ "${config}" = "omrvpn" ]; then
|
||||||
|
metric="1500"
|
||||||
|
elif [ "${config}" = "omr6in4" ]; then
|
||||||
|
metric="1201"
|
||||||
fi
|
fi
|
||||||
config_set "$config" metric $metric
|
config_set "$config" metric $metric
|
||||||
uci -q set network.${config}.metric=$metric
|
uci -q set network.${config}.metric=$metric
|
||||||
|
@ -513,7 +513,7 @@ remove() {
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
local intf=$1
|
local intf=$1
|
||||||
local id count intfmaster
|
local id intfmaster
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
. /lib/functions/network.sh
|
. /lib/functions/network.sh
|
||||||
#[ -n "$intf" ] && multipath "${intf}" off 2>&1 >/dev/null
|
#[ -n "$intf" ] && multipath "${intf}" off 2>&1 >/dev/null
|
||||||
|
@ -530,7 +530,7 @@ start_service() {
|
||||||
mptcpintf=""
|
mptcpintf=""
|
||||||
mptcpmintf=""
|
mptcpmintf=""
|
||||||
master=""
|
master=""
|
||||||
count="0"
|
count=0
|
||||||
config_load openmptcprouter
|
config_load openmptcprouter
|
||||||
config_foreach interface_max_metric interface
|
config_foreach interface_max_metric interface
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue