From fffbfef0a8dee5a4c48fbcbe2a5e62f8ef7ca6ff Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 22 May 2012 16:42:04 +0200 Subject: Fix DynDNS issue introduced by f3b2b2a (_dnsIP was not set). --- etc/inc/dyndns.class | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'etc/inc/dyndns.class') diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index ddb6739..f5eac57 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -156,7 +156,7 @@ $this->_dnsZoneID = $dnsZoneID; $this->_dnsTTL = $dnsTTL; $this->_if = get_real_interface($dnsIf); - $this->_ifIP = get_interface_ip($dnsIf); + $this->_checkIP(); $this->_dnsUpdateURL = $dnsUpdateURL; $this->_dnsResultMatch = $dnsResultMatch; $this->_dnsRequestIf = get_real_interface($dnsRequestIf); @@ -168,6 +168,11 @@ unlock($dyndnslck); return; } + if(!is_ipaddr($this->_dnsIP)) { + log_error("There was an error trying to determine the public IP for interface - {$dnsIf}({$this->_if}). Probably interface is not a WAN interface."); + unlock($dyndnslck); + return; + } $this->_debugID = rand(1000000, 9999999); @@ -1024,7 +1029,6 @@ log_error("DynDns: Current WAN IP could not be determined, skipping update process."); return false; } - $this->_dnsIP = $wan_ip; $log_error = "DynDns: Current WAN IP: {$wan_ip} "; if (file_exists($this->_cacheFile)) { @@ -1134,6 +1138,8 @@ } else log_error("DynDns debug information: {$ip_address} extracted from local system."); + $this->_dnsIP = $ip_address; + return $ip_address; } -- cgit v1.1