1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 02:51:50 +00:00

Fix multipath settings

This commit is contained in:
Ycarus 2018-03-14 18:38:04 +01:00
parent 67511c83a9
commit 86c0ebf317

View file

@ -22,7 +22,7 @@ global_multipath_settings() {
} }
interface_multipath_settings() { interface_multipath_settings() {
local mode iface local mode iface name
local config="$1" local config="$1"
local intf="$2" local intf="$2"
@ -32,16 +32,19 @@ interface_multipath_settings() {
[ -n "$intf" ] && [ "$iface" != "$intf" ] && return 0 [ -n "$intf" ] && [ "$iface" != "$intf" ] && return 0
[ -z "$iface" ] && return 0 [ -z "$iface" ] && return 0
[ -n "$(ifconfig | grep $iface)" ] || return 0 [ -n "$(ifconfig | grep $iface)" ] || return 0
[ -n "$(ubus -v call system board | jsonfilter -e '$.board_name' | grep raspberry)" ] && {
ethtool --offload $iface rx off tx off
}
config_get mode "$config" multipath "off" config_get mode "$config" multipath "off"
[ "$mode" = "master" ] && mode="on"
multipath "$iface" "$mode"
[ "$mode" = "off" ] && { [ "$mode" = "off" ] && {
ip rule del table $id > /dev/null 2>&1 ip rule del table $id > /dev/null 2>&1
ip route flush $id > /dev/null 2>&1 ip route flush $id > /dev/null 2>&1
return 1 return 1
} }
[ "$mode" = "master" ] && mode="on"
multipath "$iface" "$mode"
# IPv4 Updates: # IPv4 Updates:
local ipaddr local ipaddr
local gateway local gateway
@ -86,7 +89,7 @@ load_interfaces() {
start_service() { start_service() {
local intf=$1 local intf=$1
local id count local id count boardname
. /lib/functions.sh . /lib/functions.sh
. /lib/functions/network.sh . /lib/functions/network.sh
global_multipath_settings global_multipath_settings