diff options
author | David Yang <mmyangfl@gmail.com> | 2017-10-28 22:48:38 +0800 |
---|---|---|
committer | David Yang <mmyangfl@gmail.com> | 2017-11-08 16:14:50 +0800 |
commit | 6f38affd0c0a41c68a6249e9e934ffa718b1500d (patch) | |
tree | cb4357cf25d3f4e51fae7157248e194d5c9251ba /net/mwan3/files/etc/hotplug.d | |
parent | 5688f3e65a802bb41a84545a60fa31a73770f847 (diff) |
mwan3: fix empty gateway when creating routing table
Interfaces of some PtP protocols do not have a real gateway. In that
case ubus may fill them with '0.0.0.0' or even leave it blank. This
will cause error when adding new routing rule.
Signed-off-by: David Yang <mmyangfl@gmail.com>
Diffstat (limited to 'net/mwan3/files/etc/hotplug.d')
-rw-r--r-- | net/mwan3/files/etc/hotplug.d/iface/15-mwan3 | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 index 27033d582..3ef856580 100644 --- a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 +++ b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 @@ -26,24 +26,20 @@ if [ "$ACTION" == "ifup" ]; then if [ "$family" = "ipv4" ]; then ubus call network.interface.${INTERFACE}_4 status &>/dev/null if [ "$?" -eq "0" ]; then - network_get_gateway gateway ${INTERFACE}_4 network_get_ipaddr src_ip ${INTERFACE}_4 else - network_get_gateway gateway $INTERFACE network_get_ipaddr src_ip ${INTERFACE} fi elif [ "$family" = "ipv6" ]; then ubus call network.interface.${INTERFACE}_6 status &>/dev/null if [ "$?" -eq "0" ]; then - network_get_gateway6 gateway ${INTERFACE}_6 network_get_ipaddr6 src_ip ${INTERFACE}_6 else - network_get_gateway6 gateway ${INTERFACE} network_get_ipaddr6 src_ip ${INTERFACE} fi fi - [ -n "$gateway" ] || exit 9 + [ -n "$src_ip" ] || exit 9 fi if [ "$initial_state" = "offline" ]; then |