summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcp.php
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2017-02-22 02:23:33 +0100
committerGitHub <noreply@github.com>2017-02-22 02:23:33 +0100
commite83c9b733c86f39a14a874b115f2b8e0adc952e7 (patch)
treed1c93e518b4c1bb1360228f6fe7daffd08748887 /src/usr/local/www/services_dhcp.php
parentc6d03f09e035806dca8ac3314b41a3eaf523ab3f (diff)
downloadpfsense-e83c9b733c86f39a14a874b115f2b8e0adc952e7.zip
pfsense-e83c9b733c86f39a14a874b115f2b8e0adc952e7.tar.gz
Check that DHCP registration isn't enabled for DNS forwarder/resolver when disabling DHCP server
Diffstat (limited to 'src/usr/local/www/services_dhcp.php')
-rw-r--r--src/usr/local/www/services_dhcp.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php
index bed5cfb..3e57cea 100644
--- a/src/usr/local/www/services_dhcp.php
+++ b/src/usr/local/www/services_dhcp.php
@@ -417,6 +417,16 @@ if (isset($_POST['save'])) {
$input_errors[] = sprintf(gettext("The DHCP relay on the %s interface must be disabled before enabling the DHCP server."), $iflist[$if]);
}
+ /* If disabling DHCP Server, make sure that DHCP registration isn't enabled for DNS forwarder/resolver */
+ if (!$_POST['enable']) {
+ if (isset($config['dnsmasq']['enable']) && (isset($config['dnsmasq']['regdhcp']) || isset($config['dnsmasq']['regdhcpstatic']) || isset($config['dnsmasq']['dhcpfirst']))) {
+ $input_errors[] = gettext("Disable DHCP Registration features in DNS Forwarder before disabling DHCP Server.");
+ }
+ if (isset($config['unbound']['enable']) && (isset($config['unbound']['regdhcp']) || isset($config['unbound']['regdhcpstatic']))) {
+ $input_errors[] = gettext("Disable DHCP Registration features in DNS Resolver before disabling DHCP Server.");
+ }
+ }
+
// If nothing is wrong so far, and we have range from and to, then check conditions related to the values of range from and to.
if (!$input_errors && $_POST['range_from'] && $_POST['range_to']) {
/* make sure the range lies within the current subnet */
OpenPOWER on IntegriCloud