Commit 8c224f79 authored by Franco Fichtner's avatar Franco Fichtner

inc: another crash report, fix style while at it

parent 85cc2423
......@@ -450,7 +450,7 @@ function services_dhcpdv4_configure()
$custoptions = "";
foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
if(is_array($dhcpifconf['numberoptions']) && is_array($dhcpifconf['numberoptions']['item'])) {
if (isset($dhcpifconf['numberoptions']['item'])) {
foreach($dhcpifconf['numberoptions']['item'] as $itemidx => $item) {
if(!empty($item['type']))
$itemtype = $item['type'];
......
......@@ -294,33 +294,42 @@ function system_hosts_generate()
}
}
if (isset($dnsmasqcfg['regdhcpstatic']) && is_array($config['dhcpd'])) {
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf)
if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
foreach ($dhcpifconf['staticmap'] as $host)
if ($host['ipaddr'] && $host['hostname'] && $host['domain'])
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
if (isset($dhcpifconf['staticmap']) && isset($dhcpifconf['enable'])) {
foreach ($dhcpifconf['staticmap'] as $host) {
if ($host['ipaddr'] && $host['hostname'] && $host['domain']) {
$dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$host['domain']} {$host['hostname']}\n";
else if ($host['ipaddr'] && $host['hostname'] && $dhcpifconf['domain'])
} elseif ($host['ipaddr'] && $host['hostname'] && $dhcpifconf['domain']) {
$dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$dhcpifconf['domain']} {$host['hostname']}\n";
else if ($host['ipaddr'] && $host['hostname'])
} elseif ($host['ipaddr'] && $host['hostname']) {
$dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n";
}
}
}
}
}
if (isset($dnsmasqcfg['regdhcpstatic']) && is_array($config['dhcpdv6'])) {
foreach ($config['dhcpdv6'] as $dhcpif => $dhcpifconf)
if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
foreach ($dhcpifconf['staticmap'] as $host)
if ($host['ipaddrv6'] && $host['hostname'] && $host['domain'])
foreach ($config['dhcpdv6'] as $dhcpif => $dhcpifconf) {
if (isset($dhcpifconf['staticmap']) && isset($dhcpifconf['enable'])) {
foreach ($dhcpifconf['staticmap'] as $host) {
if ($host['ipaddrv6'] && $host['hostname'] && $host['domain']) {
$dhosts .= "{$host['ipaddrv6']} {$host['hostname']}.{$host['domain']} {$host['hostname']}\n";
else if ($host['ipaddrv6'] && $host['hostname'] && $dhcpifconf['domain'])
} elseif ($host['ipaddrv6'] && $host['hostname'] && $dhcpifconf['domain']) {
$dhosts .= "{$host['ipaddrv6']} {$host['hostname']}.{$dhcpifconf['domain']} {$host['hostname']}\n";
else if ($host['ipaddrv6'] && $host['hostname'])
} elseif ($host['ipaddrv6'] && $host['hostname']) {
$dhosts .= "{$host['ipaddrv6']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n";
}
}
}
}
}
if (isset($dnsmasqcfg['dhcpfirst']))
if (isset($dnsmasqcfg['dhcpfirst'])) {
$hosts .= $dhosts . $lhosts;
else
} else {
$hosts .= $lhosts . $dhosts;
}
}
/*
* Do not remove this because dhcpleases monitors with kqueue
......@@ -1800,4 +1809,3 @@ function get_possible_traffic_source_addresses($include_ipv6_link_local=false) {
}
return $sourceips;
}
?>
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