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