From 12ecfda3dc28218933e60d55e8c8e3cad0385970 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Thu, 6 Dec 2018 15:49:14 +0100 Subject: [PATCH] Disable multipath on interface not used --- mptcp/files/etc/init.d/mptcp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index 1460b8f91..0535336da 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -44,11 +44,11 @@ interface_multipath_settings() { config_get enabled "$config" auto "1" config_get iface "$config" ifname - count=$(($count+1)) [ -z "$iface" ] && iface=$(ifstatus "$config" | jsonfilter -q -e '@["l3_device"]') [ "$enabled" = "0" ] && return 0 + count=$(($count+1)) id=$count [ -n "$intf" ] && [ "$iface" != "$intf" ] && return 0 [ -z "$iface" ] && return 0 @@ -93,7 +93,7 @@ interface_multipath_settings() { ip rule del table $id > /dev/null 2>&1 ip route flush $id > /dev/null 2>&1 if [ -n "$gateway" ] && [ -n "$network" ]; then - ip rule add from $ipaddr iif $iface oif $iface table $id pref 0 + ip rule add from $ipaddr iif $iface oif $iface table $id ip route replace $network/$netmask dev $iface scope link table $id ip route replace default via $gateway dev $iface table $id ip route flush $id @@ -141,7 +141,7 @@ interface_multipath_settings() { ip -6 rule del table 6$id > /dev/null 2>&1 ip -6 route flush 6$id > /dev/null 2>&1 if [ -n "$ip6addr" ] && [ -n "$gateway6" ] && [ -n "$network6" ]; then - ip -6 rule add from $ip6addr iif $iface oif $iface table 6$id pref 0 + ip -6 rule add from $ip6addr iif $iface oif $iface table 6$id ip -6 route replace $network6/$netmask6 dev $iface scope link table 6$id ip -6 route replace default via $gateway6 dev $iface table 6$id ip -6 route flush 6$id