diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index 3326a1916..287a78b4d 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -79,8 +79,8 @@ interface_multipath_settings() { gateway=$(ip -4 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n") [ -z "$gateway" ] && gateway=$(uci -q get "network.$config.gateway") [ -z "$gateway" ] && gateway=$(ubus call network.interface.$config status | jsonfilter -q -e '@.route[0].nexthop' | tr -d "\n") - [ -z "$gateway" ] || [ "$( valid_subnet4 $gateway)" = "ok" ] && gateway=$(ubus call network.interface.$config status | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") - [ -z "$gateway" ] || [ "$( valid_subnet4 $gateway)" = "ok" ] && gateway=$(ubus call network.interface.${config}_4 status 2>/dev/null | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") + [ -z "$gateway" ] || [ "$( valid_subnet4 $gateway )" != "ok" ] && gateway=$(ubus call network.interface.$config status | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") + [ -z "$gateway" ] || [ "$( valid_subnet4 $gateway )" != "ok" ] && gateway=$(ubus call network.interface.${config}_4 status 2>/dev/null | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") netmask=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f2 | tr -d "\n") network=`ipcalc.sh $ipaddr $netmask | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'` fi @@ -122,8 +122,8 @@ interface_multipath_settings() { gateway6=$(ip -6 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n") [ -z "$gateway6" ] && gateway6=$(uci -q get "network.$config.ip6gw") [ -z "$gateway6" ] && gateway6=$(ubus call network.interface.$config status | jsonfilter -q -e '@.route[0].nexthop' | tr -d "\n") - [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6)" = "ok" ] && gateway6=$(ubus call network.interface.$config status | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") - [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6)" = "ok" ] && gateway6=$(ubus call network.interface.${config}_6 status 2>/dev/null | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") + [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6 )" != "ok" ] && gateway6=$(ubus call network.interface.$config status | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") + [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6 )" != "ok" ] && gateway6=$(ubus call network.interface.${config}_6 status 2>/dev/null | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") netmask6=$(ip -6 addr show dev $iface | grep -v 'scope link' | grep inet6 | awk '{print $2}' | cut -d/ -f2 | tr -d "\n") network6=`ipcalc $ip6addr | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'` fi