diff options
-rw-r--r-- | etc/inc/pfsense-utils.inc | 20 | ||||
-rw-r--r-- | etc/inc/services.inc | 6 |
2 files changed, 16 insertions, 10 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 4372daa..9214b6a 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1059,17 +1059,21 @@ function is_dhcp_server_enabled() $Iflist = get_configured_interface_list(); - foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) { - if (isset($dhcpifconf['enable']) && isset($Iflist[$dhcpif])) { - $dhcpdenable = true; - break; + if(is_array($config['dhcpd'])) { + foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) { + if (isset($dhcpifconf['enable']) && isset($Iflist[$dhcpif])) { + $dhcpdenable = true; + break; + } } } - foreach ($config['dhcpdv6'] as $dhcpv6if => $dhcpv6ifconf) { - if (isset($dhcpv6ifconf['enable']) && isset($Iflist[$dhcpv6if])) { - $dhcpdenable = true; - break; + if(is_array($config['dhcpdv6'])) { + foreach ($config['dhcpdv6'] as $dhcpv6if => $dhcpv6ifconf) { + if (isset($dhcpv6ifconf['enable']) && isset($Iflist[$dhcpv6if])) { + $dhcpdenable = true; + break; + } } } diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 4f7cd03..65e50ff 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -112,8 +112,10 @@ function services_dhcpd_configure() { } $syscfg = $config['system']; - $dhcpdcfg = $config['dhcpd']; - $dhcpdv6cfg = $config['dhcpdv6']; + if (!is_array($config['dhcpd'])) + $config['dhcpd'] = array(); + if (!is_array($config['dhcpdv6'])) + $config['dhcpdv6'] = array(); $Iflist = get_configured_interface_list(); if ($g['booting']) |