From 4d076356d5442b68d9277ba5f30870f1eb24829a Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 30 Apr 2014 18:41:12 +0000 Subject: Take care of interfaces that have no ip but might be part of the bridge as done for openvpn to avoid loops --- etc/rc.newwanip | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'etc') diff --git a/etc/rc.newwanip b/etc/rc.newwanip index 201f085..806a75c 100755 --- a/etc/rc.newwanip +++ b/etc/rc.newwanip @@ -89,13 +89,17 @@ else { log_error("rc.newwanip: on (IP address: {$curwanip}) (interface: {$interface_descr}[{$interface}]) (real interface: {$interface_real})."); /* - * NOTE: Take care of openvpn and similar if you generate the event to reconfigure an interface. + * NOTE: Take care of openvpn and no-ip interfaces or similar if you generate the event to reconfigure an interface. * i.e. OpenVPN might be in tap mode and not have an ip. */ -if (($curwanip == "0.0.0.0" || !is_ipaddr($curwanip)) && substr($interface_real, 0, 4) != "ovpn") { - log_error("rc.newwanip: Failed to update {$interface} IP, restarting..."); - send_event("interface reconfigure {$interface}"); - exit; +if ($curwanip == "0.0.0.0" || !is_ipaddr($curwanip)) { + if (substr($interface_real, 0, 4) != "ovpn") { + if (!empty($config['interfaces'][$interface]['ipaddr'])) { + log_error("rc.newwanip: Failed to update {$interface} IP, restarting..."); + send_event("interface reconfigure {$interface}"); + exit; + } + } } /* XXX: This really possible? */ -- cgit v1.1