From ebd02c22cf3bb1d823fae4339c6c642487cf29d9 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 2 Feb 2016 18:44:01 +0100 Subject: [PATCH] (legacy) unbound renders some illegal output for empty ipv6, closes https://github.com/opnsense/core/issues/738 --- src/etc/inc/unbound.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/etc/inc/unbound.inc b/src/etc/inc/unbound.inc index d8fdb234c..828675579 100644 --- a/src/etc/inc/unbound.inc +++ b/src/etc/inc/unbound.inc @@ -162,11 +162,11 @@ EOF; $active_interfaces = explode(",", $config['unbound']['active_interface']); foreach($active_interfaces as $ubif) { $intip = get_interface_ip($ubif); - if (!is_null($intip)) { + if (!empty($intip)) { $bindints .= "interface: $intip\n"; } $intip = get_interface_ipv6($ubif); - if (!is_null($intip)) { + if (!empty($intip)) { $bindints .= "interface: $intip\n"; } } @@ -182,11 +182,11 @@ EOF; $outgoing_interfaces = explode(",", $config['unbound']['outgoing_interface']); foreach($outgoing_interfaces as $outif) { $outip = get_interface_ip($outif); - if (!is_null($outip)) { + if (!empty($outip)) { $outgoingints .= "outgoing-interface: $outip\n"; } $outip = get_interface_ipv6($outif); - if (!is_null($outip)) { + if (!empty($outip)) { $outgoingints .= "outgoing-interface: $outip\n"; } } @@ -687,13 +687,13 @@ function unbound_acls_config() { $bindints = ""; foreach($active_interfaces as $ubif => $ifdesc) { $ifip = get_interface_ip($ubif); - if (!is_null($ifip)) { + if (!empty($ifip)) { $subnet_bits = get_interface_subnet($ubif); $subnet_ip = gen_subnet($ifip, $subnet_bits); $aclcfg .= "access-control: {$subnet_ip}/{$subnet_bits} allow\n"; } $ifip = get_interface_ipv6($ubif); - if (!is_null($ifip)) { + if (!empty($ifip)) { $subnet_bits = get_interface_subnetv6($ubif); $subnet_ip = gen_subnetv6($ifip, $subnet_bits); $aclcfg .= "access-control: {$subnet_ip}/{$subnet_bits} allow\n";