summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2016-02-12 13:24:12 -0500
committerjim-p <jimp@pfsense.org>2016-02-12 13:24:12 -0500
commit57b5da701888602edb008fbd55f6e55e18578eb8 (patch)
treed6552147655b03181f1ae426b54a45ce8e2f3f82 /src/usr/local/www
parentb866103e83ccf565086bcc4a4348c6866359a44a (diff)
downloadpfsense-57b5da701888602edb008fbd55f6e55e18578eb8.zip
pfsense-57b5da701888602edb008fbd55f6e55e18578eb8.tar.gz
Refine the way the DNS Forwarder and DNS Resolver are handled via XMLRPC. Fixes #5882
Diffstat (limited to 'src/usr/local/www')
-rwxr-xr-xsrc/usr/local/www/xmlrpc.php47
1 files changed, 27 insertions, 20 deletions
diff --git a/src/usr/local/www/xmlrpc.php b/src/usr/local/www/xmlrpc.php
index d2d8ded..c516c54 100755
--- a/src/usr/local/www/xmlrpc.php
+++ b/src/usr/local/www/xmlrpc.php
@@ -211,18 +211,6 @@ function restore_config_section_xmlrpc($raw_params) {
return $xmlrpc_g['return']['authfail'];
}
- /*
- * Make sure it doesn't end up with both dnsmasq and unbound enabled
- * simultaneously in secondary
- * */
- if (isset($params[0]['unbound']['enable']) && isset($config['dnsmasq']['enable'])) {
- unset($config['dnsmasq']['enable']);
- services_dnsmasq_configure();
- } else if (isset($params[0]['dnsmasq']['enable']) && isset($config['unbound']['enable'])) {
- unset($config['unbound']['enable']);
- services_unbound_configure();
- }
-
// Some sections should just be copied and not merged or we end
// up unable to sync the deletion of the last item in a section
$sync_full = array('dnsmasq', 'unbound', 'ipsec', 'aliases', 'wol', 'load_balancer', 'openvpn', 'cert', 'ca', 'crl', 'schedules', 'filter', 'nat', 'dhcpd', 'dhcpv6');
@@ -413,7 +401,7 @@ $filter_configure_sig = array(
);
function filter_configure_xmlrpc($raw_params) {
- global $xmlrpc_g, $config;
+ global $xmlrpc_g, $g, $config;
$params = xmlrpc_params_to_php($raw_params);
if (!xmlrpc_auth($params)) {
@@ -426,16 +414,35 @@ function filter_configure_xmlrpc($raw_params) {
relayd_configure();
require_once("openvpn.inc");
openvpn_resync_all();
+
+ /* The DNS Resolver and the DNS Forwarder may both be active so long as
+ * they are running on different ports. See ticket #5882
+ */
+ $need_dhcp_start = true;
if (isset($config['dnsmasq']['enable'])) {
- services_dnsmasq_configure();
- } elseif (isset($config['unbound']['enable'])) {
- services_unbound_configure();
+ /* Configure dnsmasq but tell it NOT to restart DHCP */
+ services_dnsmasq_configure(false);
+ } else {
+ /* kill any running dnsmasq since it is not enabled. */
+ if (file_exists("{$g['varrun_path']}/dnsmasq.pid")) {
+ sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM");
+ }
+ }
+ if (isset($config['unbound']['enable'])) {
+ /* Configure unbound but tell it NOT to restart DHCP */
+ services_unbound_configure(false);
} else {
- # Both calls above run services_dhcpd_configure(), then we just
- # need to call it when they are not called to avoid restarting dhcpd
- # twice, as described on ticket #3797
- services_dhcpd_configure();
+ /* kill any running Unbound instance since it is not enabled. */
+ if (file_exists("{$g['varrun_path']}/unbound.pid")) {
+ sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM");
+ }
}
+
+ /* Call this separately since the above are manually set to skip the DHCP restart they normally perform.
+ * This avoids restarting dhcpd twice as described on ticket #3797
+ */
+ services_dhcpd_configure();
+
local_sync_accounts();
return $xmlrpc_g['return']['true'];
OpenPOWER on IntegriCloud