summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-02-18 08:34:29 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-02-18 08:35:44 -0300
commit9e875e0c00b4707e0b13473af431c842f2d42974 (patch)
tree5706b0b407169c1ba77d023def93e659e9c11473 /etc
parent8c1470775944fe3041ede87e811ed8fa3a2608fa (diff)
downloadpfsense-9e875e0c00b4707e0b13473af431c842f2d42974.zip
pfsense-9e875e0c00b4707e0b13473af431c842f2d42974.tar.gz
Revert "Replaced gethostbyname() with gethostbynamel() to get a list of all IPs associated with the dns name and add them to the allowed list"
This change is not needed, filterdns will handle it. This reverts commit d460371416d4e2cfef976d5a7616f63f6faa203f.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc22
1 files changed, 10 insertions, 12 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 9713e97..fc813ad 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1028,13 +1028,13 @@ function captiveportal_allowedip_configure_entry($ipent, $ishostname = false) {
*/
if ($ishostname === true) {
if (!$g['booting']) {
- $ipaddress = gethostbynamel($ipent['hostname']);
- if(!is_array($ipaddress) || empty($ipaddress))
+ $ipaddress = gethostbyname($ipent['hostname']);
+ if (!is_ipaddr($ipaddress))
return;
- } else
- $ipaddress = array();
- } else
- $ipaddress = array($ipent['ip']);
+ } else
+ $ipaddress = "";
+ } else
+ $ipaddress = $ipent['ip'];
$rules = "";
$cp_filterdns_conf = "";
@@ -1048,17 +1048,15 @@ function captiveportal_allowedip_configure_entry($ipent, $ishostname = false) {
if ($ishostname === true) {
$cp_filterdns_conf .= "ipfw {$ipent['hostname']} 3 pipe {$pipeno}\n";
$cp_filterdns_conf .= "ipfw {$ipent['hostname']} 4 pipe {$pipedown}\n";
- if (empty($ipaddress))
+ if (!is_ipaddr($ipaddress))
return array("", $cp_filterdns_conf);
}
$subnet = "";
if (!empty($ipent['sn']))
$subnet = "/{$ipent['sn']}";
- foreach($ipaddress AS $one_address) {
- $rules .= "table 3 add {$one_address}{$subnet} {$pipeno}\n";
- $rules .= "table 4 add {$one_address}{$subnet} {$pipedown}\n";
- }
-
+ $rules .= "table 3 add {$ipaddress}{$subnet} {$pipeno}\n";
+ $rules .= "table 4 add {$ipaddress}{$subnet} {$pipedown}\n";
+
if ($ishostname === true)
return array($rules, $cp_filterdns_conf);
else
OpenPOWER on IntegriCloud