diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-21 14:43:23 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-21 14:43:23 -0300 |
commit | 44787658392c1c4adbe9aef38251cd1276bf0660 (patch) | |
tree | 6d8c5737ba4cd2f658290f4f527270dcb4ea4f37 /etc/inc/services.inc | |
parent | 18f523b7ca9d542ccb8b85a939a9e4cdc92cc277 (diff) | |
parent | 89735da238ed1b173942bdc24e4bc2f4c8543555 (diff) | |
download | pfsense-44787658392c1c4adbe9aef38251cd1276bf0660.zip pfsense-44787658392c1c4adbe9aef38251cd1276bf0660.tar.gz |
Merge pull request #1836 from phil-davis/patch-4
Diffstat (limited to 'etc/inc/services.inc')
-rw-r--r-- | etc/inc/services.inc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 4b6c4e2..b8579fe 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -675,8 +675,16 @@ EOPP; $dhcpdconf .= "subnet {$subnet} netmask {$subnetmask} {\n"; -// Setup pool options + // 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] <> "") { |