diff options
author | Renato Botelho <renato@netgate.com> | 2016-12-20 15:50:17 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-12-20 15:51:02 -0200 |
commit | e66503688e06a8ce19875863ee87356bb4ce3cf8 (patch) | |
tree | 7e84e86d9e59b96380b6967c7a4afa2c264adf95 /src/usr/local/www/interfaces.php | |
parent | f75f0ef76349ebee3ab2afb3d1e75ab5c637118f (diff) | |
download | pfsense-e66503688e06a8ce19875863ee87356bb4ce3cf8.zip pfsense-e66503688e06a8ce19875863ee87356bb4ce3cf8.tar.gz |
Disable DHCP server on interfaces with subnet >= 31. Fixes #6930
Diffstat (limited to 'src/usr/local/www/interfaces.php')
-rw-r--r-- | src/usr/local/www/interfaces.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 292cd00..234a0c6 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -548,8 +548,20 @@ if ($_POST['apply']) { $input_errors[] = gettext("The interface description cannot contain only numbers."); } /* input validation */ - if (isset($config['dhcpd']) && isset($config['dhcpd'][$if]['enable']) && (!preg_match("/^staticv4/", $_POST['type']))) { - $input_errors[] = gettext("The DHCP Server is active on this interface and it can be used only with a static IP configuration. Please disable the DHCP Server service on this interface first, then change the interface configuration."); + if (isset($config['dhcpd']) && isset($config['dhcpd'][$if]['enable'])) { + if (!preg_match("/^staticv4/", $_POST['type'])) { + $input_errors[] = gettext("The DHCP Server is active " . + "on this interface and it can be used only with " . + "a static IP configuration. Please disable the " . + "DHCP Server service on this interface first, " . + "then change the interface configuration."); + } elseif (!empty($_POST['subnet']) && $_POST['subnet'] >= 31) { + $input_errors[] = gettext("The DHCP Server is active " . + "on this interface and it can be used only with " . + "IPv4 subnet < 31. Please disable the " . + "DHCP Server service on this interface first, " . + "then change the interface configuration."); + } } if (isset($config['dhcpdv6']) && isset($config['dhcpdv6'][$if]['enable']) && ($_POST['type6'] != "staticv6" && $_POST['type6'] != "track6")) { $input_errors[] = gettext("The DHCP6 Server is active on this interface and it can be used only with a static IPv6 configuration. Please disable the DHCPv6 Server service on this interface first, then change the interface configuration."); |