summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-07-20 19:06:03 +0000
committerErmal Luçi <eri@pfsense.org>2008-07-20 19:06:03 +0000
commitb88e05cb70631a5792356158f020765ba84e9e44 (patch)
treeb53266b483a7ca6cc184d063d5a7b36f0c5e68b9
parent13db70b41b9b126ae804fc8cec0b17ef721c326f (diff)
downloadpfsense-b88e05cb70631a5792356158f020765ba84e9e44.zip
pfsense-b88e05cb70631a5792356158f020765ba84e9e44.tar.gz
* Make some sanity checks before using CURLOPT_SETINTERFACE
* close the curl instance after using it. With CURLOPT_SETINTERFACE a new instance is needed to correcly use it.
-rw-r--r--etc/inc/dyndns.class4
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index fc06303..75bc749 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -853,8 +853,10 @@
$ip_ch = curl_init('http://checkip.dyndns.org');
curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ip_ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ip_ch, CURLOPT_SETINTERFACE, $this->_dnsIP);
+ if ($this->_dnsIP <> "" || $this->_dnsIP <> "0.0.0.0")
+ curl_setopt($ip_ch, CURLOPT_SETINTERFACE, $this->_dnsIP);
$ip_result_page = curl_exec($ip_ch);
+ curl_close($ip_ch);
$ip_result_decoded = urldecode($ip_result_page);
preg_match('=Current IP Address: (.*)</body>=siU', $ip_result_decoded, $matches);
$ip_address = trim($matches[1]);
OpenPOWER on IntegriCloud