mwan3: reduce dependency on src_ip

Interfaces may be managed by 3rd-party scripts, thus src_ip may not be
always available in uci.

Signed-off-by: David Yang <mmyangfl@gmail.com>
This commit is contained in:
David Yang
2017-11-02 09:33:59 +08:00
parent 6f38affd0c
commit e094212b17
3 changed files with 10 additions and 18 deletions
+2 -2
View File
@@ -30,6 +30,7 @@ if [ "$ACTION" == "ifup" ]; then
else
network_get_ipaddr src_ip ${INTERFACE}
fi
[ -n "$src_ip" ] || src_ip="0.0.0.0"
elif [ "$family" = "ipv6" ]; then
ubus call network.interface.${INTERFACE}_6 status &>/dev/null
if [ "$?" -eq "0" ]; then
@@ -37,9 +38,8 @@ if [ "$ACTION" == "ifup" ]; then
else
network_get_ipaddr6 src_ip ${INTERFACE}
fi
[ -n "$src_ip" ] || src_ip="::"
fi
[ -n "$src_ip" ] || exit 9
fi
if [ "$initial_state" = "offline" ]; then