dhcp: remove interface key #4642

At first the idea was to pass it, but especially since this only
passes one entry as noted by @maurice-w it is probably better to
ditch it.  :)
This commit is contained in:
Franco Fichtner 2021-02-24 20:00:34 +01:00
parent f67e242eaa
commit e73db9c7ae
3 changed files with 5 additions and 5 deletions

View File

@ -1924,7 +1924,7 @@ function dhcpd_staticmap($inet = 4, $domain_fallback = 'not.found', $ifconfig_de
$domain = explode(";", $domain)[0]; // XXX: first entry of domainsearchlist
$staticmap[$dhcpif] = [
$staticmap[] = [
'descr' => $host['descr'],
'domain' => $domain,
'hostname' => $host['hostname'],

View File

@ -233,11 +233,11 @@ function _dnsmasq_add_host_entries()
$ifconfig_details = legacy_interfaces_details();
foreach (dhcpd_staticmap(4, $domain, $ifconfig_details) as $dhcpif => $host) {
foreach (dhcpd_staticmap(4, $domain, $ifconfig_details) as $host) {
$dhosts .= "{$host['ipaddr']}\t{$host['hostname']}.{$host['domain']} {$host['hostname']}\n";
}
foreach (dhcpd_staticmap(6, $domain, $ifconfig_details) as $dhcpif => $host) {
foreach (dhcpd_staticmap(6, $domain, $ifconfig_details) as $host) {
$dhosts .= "{$host['ipaddrv6']}\t{$host['hostname']}.{$host['domain']} {$host['hostname']}\n";
}
}

View File

@ -650,7 +650,7 @@ function unbound_add_host_entries($ifconfig_details = null)
if (isset($config['unbound']['regdhcpstatic'])) {
require_once 'plugins.inc.d/dhcpd.inc'; /* XXX */
foreach (dhcpd_staticmap(4, $config['system']['domain'], $ifconfig_details) as $dhcpif => $host) {
foreach (dhcpd_staticmap(4, $config['system']['domain'], $ifconfig_details) as $host) {
$unbound_entries .= "local-data-ptr: \"{$host['ipaddr']} {$host['hostname']}.{$host['domain']}\"\n";
$unbound_entries .= "local-data: \"{$host['hostname']}.{$host['domain']} IN A {$host['ipaddr']}\"\n";
if (!empty($host['descr']) && $unboundcfg['txtsupport'] == 'on') {
@ -658,7 +658,7 @@ function unbound_add_host_entries($ifconfig_details = null)
}
}
foreach (dhcpd_staticmap(6, $config['system']['domain'], $ifconfig_details) as $dhcpif => $host) {
foreach (dhcpd_staticmap(6, $config['system']['domain'], $ifconfig_details) as $host) {
$unbound_entries .= "local-data-ptr: \"{$host['ipaddrv6']} {$host['hostname']}.{$host['domain']}\"\n";
$unbound_entries .= "local-data: \"{$host['hostname']}.{$host['domain']} IN AAAA {$host['ipaddrv6']}\"\n";
if (!empty($host['descr']) && $unboundcfg['txtsupport'] == 'on') {