diff options
author | Warren Baker <warren@decoy.co.za> | 2014-03-29 14:47:43 +0200 |
---|---|---|
committer | Warren Baker <warren@decoy.co.za> | 2014-03-29 14:47:43 +0200 |
commit | 58d00e65c9641d42db6544f4bb04d178e7886a7f (patch) | |
tree | ded5c9a1ef01072456568af492954de9c4cb62d5 /etc | |
parent | e91626775fa96214bd6c4819c22d8bb07af70f4e (diff) | |
download | pfsense-58d00e65c9641d42db6544f4bb04d178e7886a7f.zip pfsense-58d00e65c9641d42db6544f4bb04d178e7886a7f.tar.gz |
Write out the access list correctly
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/unbound.inc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc index be2c7ad..f462e62 100644 --- a/etc/inc/unbound.inc +++ b/etc/inc/unbound.inc @@ -605,13 +605,17 @@ EOF; // Unbound Access lists function unbound_acls_config() { - global $config; + global $g, $config; $aclcfg = ""; // Add our networks for active interfaces including localhost - $active_interfaces = explode(",", $config['unbound']['active_interface']); + if (!empty($config['unbound']['active_interface'])) + $active_interfaces = array_flip(explode(",", $config['unbound']['active_interface'])); + else + $active_interfaces = get_configured_interface_with_descr(); + $bindints = ""; - foreach($active_interfaces as $ubif) { + foreach($active_interfaces as $ubif => $ifdesc) { $ifip = get_interface_ip($ubif); if (!is_null($ifip)) { $subnet_bits = get_interface_subnet($ubif); @@ -630,10 +634,10 @@ function unbound_acls_config() { $aclcfg .= "access-control: {$network['acl_network']}/{$network['mask']} {$unbound_acl['aclaction']}\n"; } } - // Write out Access list - file_put_contents("{$g['unbound_chroot_path']}/access_lists.conf", $aclcfg); - } else - return; + } + // Write out Access list + file_put_contents("{$g['unbound_chroot_path']}/access_lists.conf", $aclcfg); + } ?>
\ No newline at end of file |