Commit ebd02c22 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) unbound renders some illegal output for empty ipv6, closes...

(legacy) unbound renders some illegal output for empty ipv6, closes https://github.com/opnsense/core/issues/738
parent 555fda69
...@@ -162,11 +162,11 @@ EOF; ...@@ -162,11 +162,11 @@ EOF;
$active_interfaces = explode(",", $config['unbound']['active_interface']); $active_interfaces = explode(",", $config['unbound']['active_interface']);
foreach($active_interfaces as $ubif) { foreach($active_interfaces as $ubif) {
$intip = get_interface_ip($ubif); $intip = get_interface_ip($ubif);
if (!is_null($intip)) { if (!empty($intip)) {
$bindints .= "interface: $intip\n"; $bindints .= "interface: $intip\n";
} }
$intip = get_interface_ipv6($ubif); $intip = get_interface_ipv6($ubif);
if (!is_null($intip)) { if (!empty($intip)) {
$bindints .= "interface: $intip\n"; $bindints .= "interface: $intip\n";
} }
} }
...@@ -182,11 +182,11 @@ EOF; ...@@ -182,11 +182,11 @@ EOF;
$outgoing_interfaces = explode(",", $config['unbound']['outgoing_interface']); $outgoing_interfaces = explode(",", $config['unbound']['outgoing_interface']);
foreach($outgoing_interfaces as $outif) { foreach($outgoing_interfaces as $outif) {
$outip = get_interface_ip($outif); $outip = get_interface_ip($outif);
if (!is_null($outip)) { if (!empty($outip)) {
$outgoingints .= "outgoing-interface: $outip\n"; $outgoingints .= "outgoing-interface: $outip\n";
} }
$outip = get_interface_ipv6($outif); $outip = get_interface_ipv6($outif);
if (!is_null($outip)) { if (!empty($outip)) {
$outgoingints .= "outgoing-interface: $outip\n"; $outgoingints .= "outgoing-interface: $outip\n";
} }
} }
...@@ -687,13 +687,13 @@ function unbound_acls_config() { ...@@ -687,13 +687,13 @@ function unbound_acls_config() {
$bindints = ""; $bindints = "";
foreach($active_interfaces as $ubif => $ifdesc) { foreach($active_interfaces as $ubif => $ifdesc) {
$ifip = get_interface_ip($ubif); $ifip = get_interface_ip($ubif);
if (!is_null($ifip)) { if (!empty($ifip)) {
$subnet_bits = get_interface_subnet($ubif); $subnet_bits = get_interface_subnet($ubif);
$subnet_ip = gen_subnet($ifip, $subnet_bits); $subnet_ip = gen_subnet($ifip, $subnet_bits);
$aclcfg .= "access-control: {$subnet_ip}/{$subnet_bits} allow\n"; $aclcfg .= "access-control: {$subnet_ip}/{$subnet_bits} allow\n";
} }
$ifip = get_interface_ipv6($ubif); $ifip = get_interface_ipv6($ubif);
if (!is_null($ifip)) { if (!empty($ifip)) {
$subnet_bits = get_interface_subnetv6($ubif); $subnet_bits = get_interface_subnetv6($ubif);
$subnet_ip = gen_subnetv6($ifip, $subnet_bits); $subnet_ip = gen_subnetv6($ifip, $subnet_bits);
$aclcfg .= "access-control: {$subnet_ip}/{$subnet_bits} allow\n"; $aclcfg .= "access-control: {$subnet_ip}/{$subnet_bits} allow\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment