mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
unbound: also pick up link-local IPv6 and remove localhost
The other code does more or less the same, but it seems that a lot needs to be cleaned up still... PR: https://forum.opnsense.org/index.php?topic=3311.0
This commit is contained in:
parent
49e364be6e
commit
0dca6edd34
@ -1772,7 +1772,7 @@ function system_arp_wrong_if()
|
||||
));
|
||||
}
|
||||
|
||||
function get_possible_listen_ips($include_ipv6_link_local=false) {
|
||||
function get_possible_listen_ips($include_ipv6_link_local = false, $include_loopback = true) {
|
||||
$interfaces = get_configured_interface_with_descr();
|
||||
$carplist = get_configured_carp_interface_list();
|
||||
$listenips = array();
|
||||
@ -1796,9 +1796,11 @@ function get_possible_listen_ips($include_ipv6_link_local=false) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$tmp["name"] = "Localhost";
|
||||
$tmp["value"] = "lo0";
|
||||
$listenips[] = $tmp;
|
||||
if ($include_loopback) {
|
||||
$tmp["name"] = "Localhost";
|
||||
$tmp["value"] = "lo0";
|
||||
$listenips[] = $tmp;
|
||||
}
|
||||
return $listenips;
|
||||
}
|
||||
|
||||
|
||||
@ -556,6 +556,11 @@ function unbound_add_host_entries()
|
||||
$unbound_entries .= "local-data: \"{$config['system']['hostname']}.{$config['system']['domain']} AAAA {$laddr6}\"\n";
|
||||
$unbound_entries .= "local-data: \"{$config['system']['hostname']} AAAA {$laddr6}\"\n";
|
||||
}
|
||||
$lladdr6 = find_interface_ipv6_ll($if);
|
||||
if (is_ipaddrv6($lladdr6)) {
|
||||
$unbound_entries .= "local-data: \"{$config['system']['hostname']}.{$config['system']['domain']} AAAA {$lladdr6}\"\n";
|
||||
$unbound_entries .= "local-data: \"{$config['system']['hostname']} AAAA {$lladdr6}\"\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -172,10 +172,8 @@ include_once("head.inc");
|
||||
<select name="active_interface[]" multiple="multiple" size="3" class="selectpicker" data-live-search="true">
|
||||
<option value="" <?=empty($pconfig['active_interface'][0]) ? 'selected="selected"' : ""; ?>><?=gettext("All");?></option>
|
||||
<?php
|
||||
foreach (get_possible_listen_ips(true) as $laddr):?>
|
||||
<option value="<?=$laddr['value'];?>" <?=in_array($laddr['value'], $pconfig['active_interface']) ? 'selected="selected"' : "";?>>
|
||||
<?=htmlspecialchars($laddr['name']);?>
|
||||
</option>
|
||||
foreach (get_possible_listen_ips(false, false) as $laddr):?>
|
||||
<option value="<?=$laddr['value'];?>" <?=in_array($laddr['value'], $pconfig['active_interface']) ? 'selected="selected"' : "";?>><?=htmlspecialchars($laddr['name']);?></option>
|
||||
<?php
|
||||
endforeach; ?>
|
||||
</select>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user