summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/services.inc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-09-01 14:14:11 -0300
committerRenato Botelho <renato@netgate.com>2015-09-01 14:14:11 -0300
commit93a957b34b718afa319424ab45e26171ceff1a19 (patch)
treea65dc1813150358208b4e55ad169f31bd06a6458 /src/etc/inc/services.inc
parentde3aa3c283313e190c7f8208c4eda51fdd1903aa (diff)
parent7265700a28961b4d103d5160c95c75b0aa42811f (diff)
downloadpfsense-93a957b34b718afa319424ab45e26171ceff1a19.zip
pfsense-93a957b34b718afa319424ab45e26171ceff1a19.tar.gz
Merge branch 'master' into bootstrap
Diffstat (limited to 'src/etc/inc/services.inc')
-rw-r--r--src/etc/inc/services.inc15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index 333261d..d13f44a 100644
--- a/src/etc/inc/services.inc
+++ b/src/etc/inc/services.inc
@@ -725,6 +725,14 @@ EOPP;
// Setup pool options
foreach ($all_pools as $poolconf) {
+ if (!(ip_in_subnet($poolconf['range']['from'], "{$subnet}/{$ifcfgsn}") && ip_in_subnet($poolconf['range']['to'], "{$subnet}/{$ifcfgsn}"))) {
+ // If the user has changed the subnet from the interfaces page and applied,
+ // but has not updated the DHCP range, then the range to/from of the pool can be outside the subnet.
+ // In that case, ignore the pool and post an error.
+ $error_msg = sprintf(gettext("Invalid DHCP pool %s - %s for %s subnet %s/%s detected. Please correct the settings in Services, DHCP Server"), $poolconf['range']['from'], $poolconf['range']['to'], convert_real_interface_to_friendly_descr($dhcpif), $subnet, $ifcfgsn);
+ file_notice("DHCP", $error_msg);
+ continue;
+ }
$dhcpdconf .= " pool {\n";
/* is failover dns setup? */
if (is_array($poolconf['dnsserver']) && $poolconf['dnsserver'][0] <> "") {
@@ -2438,8 +2446,13 @@ function configure_cron() {
file_put_contents("/etc/crontab", $crontab_contents);
unset($crontab_contents);
+ /* make sure that cron is running and start it if it got killed somehow */
+ if (!is_process_running("cron")) {
+ exec("cd /tmp && /usr/sbin/cron -s 2>/dev/null");
+ } else {
/* do a HUP kill to force sync changes */
- sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
+ sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
+ }
conf_mount_ro();
}
OpenPOWER on IntegriCloud