diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index 6a4b6ee134..0491764721 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -344,8 +344,8 @@ interface_multipath_settings() { # gateway6=$(ubus call network.interface.${config}_6 status 2>/dev/null | jsonfilter -q -l 1 -e '@.inactive.route[@.target="::"].nexthop' | tr -d "\n") #fi gateway6=$(echo $gateway6 | cut -d/ -f1 | tr -d "\n") - netmask6=$(ip -6 addr show dev $iface | sort -r | grep -m 1 inet6 | awk '{print $2}' | cut -d/ -f2 | tr -d "\n") - [ -n "$ip6addr" ] && network6=`ipcalc -n $ip6addr | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'` + [ -n "$ip6addr" ] && netmask6=$(ip -6 addr show dev $iface | grep $ip6addr | grep -m 1 inet6 | awk '{print $2}' | cut -d/ -f2 | tr -d "\n") + [ -n "$ip6addr" ] && [ -n "$netmask6" ] && network6=`/usr/sbin/ipcalc -n ${ip6addr}/${netmask6} | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'` fi if [ "$(uci -q get openmptcprouter.settings.uci_route)" = "1" ]; then uci -q batch <<-EOF >/dev/null