summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-09-09 21:45:49 +0000
committerErmal Luçi <eri@pfsense.org>2008-09-09 21:45:49 +0000
commitbfe776f0b7853e110a9a587522b4e8b0a778e8b3 (patch)
tree9b238a608ef784182d507f6d54caa02a85d1a931 /etc
parentf20f946167b92166499f31a29e17c4325613ae62 (diff)
downloadpfsense-bfe776f0b7853e110a9a587522b4e8b0a778e8b3.zip
pfsense-bfe776f0b7853e110a9a587522b4e8b0a778e8b3.tar.gz
* Array checks too.
* Add some style(9) NOTE: Maybe someone needs to verify these strange checks on this function!
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc14
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 0ed6db4..d2a7567 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -3416,17 +3416,23 @@ function get_interface_gateway($interface) {
return $gw;
}
-function is_dhcp_server_enabled() {
- /* DHCP enabled on any interfaces? */
+/* DHCP enabled on any interfaces? */
+function is_dhcp_server_enabled()
+{
global $config, $g;
- $dhcpdcfg = $config['dhcpd'];
+
$dhcpdenable = false;
- foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
+
+ if (!is_array($config['dhcpd']))
+ return false;
+
+ foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
if (isset ($dhcpifconf['enable']) && (($dhcpif == "lan") || (isset ($config['interfaces'][$dhcpif]['enable']) && $config['interfaces'][$dhcpif]['if'] && (!link_int_to_bridge_interface($dhcpif)))))
$dhcpdenable = true;
if (isset ($dhcpifconf['enable']) && (($dhcpif == "wan") || (isset ($config['interfaces'][$dhcpif]['enable']) && $config['interfaces'][$dhcpif]['if'] && (!link_int_to_bridge_interface($dhcpif)))))
$dhcpdenable = true;
}
+
return $dhcpdenable;
}
OpenPOWER on IntegriCloud