summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-28 10:41:47 -0300
committerRenato Botelho <renato@netgate.com>2015-08-28 10:41:47 -0300
commit7f59ae04102df5b994370ab763b433ca399e8469 (patch)
tree6891042f55586cb8b7af034b0492ef11febdbbcd /src
parent71de40d4eecf2c4c97508882d1b1345d79e4cbed (diff)
parent9228166f430eead86103ed9d129dba7602caa980 (diff)
downloadpfsense-7f59ae04102df5b994370ab763b433ca399e8469.zip
pfsense-7f59ae04102df5b994370ab763b433ca399e8469.tar.gz
Merge pull request #1824 from phil-davis/dhcp-pools-range
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/services.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index 5f749f9..b5df650 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] <> "") {
OpenPOWER on IntegriCloud