diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php index e0c2212253..15fdd0faae 100644 --- a/usr/local/www/services_dhcp_relay.php +++ b/usr/local/www/services_dhcp_relay.php @@ -57,9 +57,12 @@ $iflist = get_configured_interface_with_descr(); */ $dhcpd_enabled = false; if (is_array($config['dhcpd'])) { - foreach($config['dhcpd'] as $dhcp) - if (isset($dhcp['enable'])) + foreach($config['dhcpd'] as $dhcpif => $dhcp) { + if (isset($dhcp['enable']) && isset($config['interfaces'][$dhcpif]['enable'])) { $dhcpd_enabled = true; + break; + } + } } if ($_POST) { diff --git a/usr/local/www/services_dhcpv6_relay.php b/usr/local/www/services_dhcpv6_relay.php index d01094ca7f..8e80bca3dc 100644 --- a/usr/local/www/services_dhcpv6_relay.php +++ b/usr/local/www/services_dhcpv6_relay.php @@ -58,9 +58,12 @@ $iflist = get_configured_interface_with_descr(); */ $dhcpd_enabled = false; if (is_array($config['dhcpdv6'])) { - foreach($config['dhcpdv6'] as $dhcp) - if (isset($dhcp['enable'])) + foreach($config['dhcpdv6'] as $dhcp) { + if (isset($dhcp['enable']) && isset($config['interfaces'][$dhcpif]['enable'])) { $dhcpd_enabled = true; + break; + } + } } if ($_POST) {