diff options
author | Chris Buechler <cmb@pfsense.org> | 2014-11-28 15:52:56 -0600 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2014-11-28 15:54:58 -0600 |
commit | b7960673bef61c323715da72d52e4aece5f1fd57 (patch) | |
tree | 463d1badb101ba4c9a98c9b080c85e96259414ed /etc/inc | |
parent | 2388a1ace93c831d203d541d38ad8e05d80ff560 (diff) | |
download | pfsense-b7960673bef61c323715da72d52e4aece5f1fd57.zip pfsense-b7960673bef61c323715da72d52e4aece5f1fd57.tar.gz |
Fix input validation for DNS resolver when localhost is enabled in resolv.conf and "all" chosen in Network Interfaces. While here, set something other than '' when all is chosen.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/unbound.inc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc index e7f12f0..76c6eef 100644 --- a/etc/inc/unbound.inc +++ b/etc/inc/unbound.inc @@ -143,13 +143,18 @@ EOF; $bindints = ""; if (!empty($config['unbound']['active_interface'])) { $active_interfaces = explode(",", $config['unbound']['active_interface']); - foreach($active_interfaces as $ubif) { - $intip = get_interface_ip($ubif); - if (is_ipaddrv4($intip)) - $bindints .= "interface: $intip\n"; - $intip = get_interface_ipv6($ubif); - if (is_ipaddrv6($intip)) - $bindints .= "interface: $intip\n"; + if (in_array("all", $active_interfaces, true)) { + $bindints .= "interface: 0.0.0.0\n"; + $bindints .= "interface: ::0\n"; + } else { + foreach($active_interfaces as $ubif) { + $intip = get_interface_ip($ubif); + if (is_ipaddrv4($intip)) + $bindints .= "interface: $intip\n"; + $intip = get_interface_ipv6($ubif); + if (is_ipaddrv6($intip)) + $bindints .= "interface: $intip\n"; + } } } else { $bindints .= "interface: 0.0.0.0\n"; |