diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-28 14:29:08 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-28 14:29:08 -0300 |
commit | a5bf7adb7bebefbfcae1ab6c1d075ef390cc0b77 (patch) | |
tree | 98a69dc1fa58dc9cd8987ae0266998c1340464a1 /etc | |
parent | 184a4999121468585010c8565a19b82918228f17 (diff) | |
parent | c5863ca1842650bd209c4cc02d0f705b9e25f594 (diff) | |
download | pfsense-a5bf7adb7bebefbfcae1ab6c1d075ef390cc0b77.zip pfsense-a5bf7adb7bebefbfcae1ab6c1d075ef390cc0b77.tar.gz |
Merge pull request #1938 from phil-davis/patch-5
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/services.inc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index b8579fe..141ebb3 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -680,9 +680,28 @@ EOPP; 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. + // This can also happen when implementing the batch of changes when the setup wizard reloads the new settings. $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); + $do_file_notice = true; + $conf_ipv4_address = $ifcfg['ipaddr']; + $conf_ipv4_subnetmask = $ifcfg['subnet']; + if (is_ipaddrv4($conf_ipv4_address) && is_subnet("{$conf_ipv4_address}/{$conf_ipv4_subnetmask}")) { + $conf_subnet_base = gen_subnet($conf_ipv4_address, $conf_ipv4_subnetmask); + if (ip_in_subnet($poolconf['range']['from'], "{$conf_subnet_base}/{$conf_ipv4_subnetmask}") && + ip_in_subnet($poolconf['range']['to'], "{$conf_subnet_base}/{$conf_ipv4_subnetmask}")) { + // Even though the running interface subnet does not match the pool range, + // the interface subnet in the config file contains the pool range. + // We are somewhere part-way through a settings reload, e.g. after running the setup wizard. + // services_dhcpdv4_configure will be called again later when the new interface settings from + // the config are applied and at that time everything will match up. + // Ignore this pool on this interface for now and just log the error to the system log. + log_error($error_msg); + $do_file_notice = false; + } + } + if ($do_file_notice) { + file_notice("DHCP", $error_msg); + } continue; } $dhcpdconf .= " pool {\n"; |