summaryrefslogtreecommitdiffstats
path: root/src/usr/local
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-22 13:07:03 -0300
committerRenato Botelho <renato@netgate.com>2017-02-22 13:07:03 -0300
commit7386f8a008e0a8cac5cd91012728b02cbda2922f (patch)
treeb0f4c4e5dd0e17756a0ef40d730d115f2744a7f4 /src/usr/local
parent4be90da55aee071798b2278a102e454a75864955 (diff)
parente83c9b733c86f39a14a874b115f2b8e0adc952e7 (diff)
downloadpfsense-7386f8a008e0a8cac5cd91012728b02cbda2922f.zip
pfsense-7386f8a008e0a8cac5cd91012728b02cbda2922f.tar.gz
Merge pull request #3568 from doktornotor/patch-7
Diffstat (limited to 'src/usr/local')
-rw-r--r--src/usr/local/www/services_dhcp.php10
-rw-r--r--src/usr/local/www/services_dnsmasq.php5
-rw-r--r--src/usr/local/www/services_unbound.php5
3 files changed, 20 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 */
diff --git a/src/usr/local/www/services_dnsmasq.php b/src/usr/local/www/services_dnsmasq.php
index c834457..ff664e5 100644
--- a/src/usr/local/www/services_dnsmasq.php
+++ b/src/usr/local/www/services_dnsmasq.php
@@ -34,6 +34,7 @@
require_once("guiconfig.inc");
require_once("functions.inc");
require_once("filter.inc");
+require_once("pfsense-utils.inc");
require_once("shaper.inc");
require_once("system.inc");
@@ -147,6 +148,10 @@ if ($_POST['save']) {
}
}
+ if ((isset($_POST['regdhcp']) || isset($_POST['regdhcpstatic']) || isset($_POST['dhcpfirst'])) && !is_dhcp_server_enabled()) {
+ $input_errors[] = gettext("DHCP Server must be enabled for DHCP Registration to work in DNS Forwarder.");
+ }
+
if ($_POST['port']) {
if (is_port($_POST['port'])) {
$config['dnsmasq']['port'] = $_POST['port'];
diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php
index 5c3caa1..e000057 100644
--- a/src/usr/local/www/services_unbound.php
+++ b/src/usr/local/www/services_unbound.php
@@ -29,6 +29,7 @@
require_once("guiconfig.inc");
require_once("unbound.inc");
+require_once("pfsense-utils.inc");
require_once("system.inc");
if (!is_array($config['unbound'])) {
@@ -153,6 +154,10 @@ if ($_POST['save']) {
$pconfig['active_interface'] = implode(",", $pconfig['active_interface']);
}
+ if ((isset($pconfig['regdhcp']) || isset($pconfig['regdhcpstatic'])) && !is_dhcp_server_enabled()) {
+ $input_errors[] = gettext("DHCP Server must be enabled for DHCP Registration to work in DNS Resolver.");
+ }
+
$display_custom_options = $pconfig['custom_options'];
$pconfig['custom_options'] = base64_encode(str_replace("\r\n", "\n", $pconfig['custom_options']));
OpenPOWER on IntegriCloud