summaryrefslogtreecommitdiffstats
path: root/usr/local/www/load_balancer_pool_edit.php
diff options
context:
space:
mode:
authorDarren Embry <dse@webonastick.com>2012-04-05 13:07:20 -0400
committerDarren Embry <dse@webonastick.com>2012-04-05 13:10:41 -0400
commit0917cb214b2bbf7f4b374c901c642987fc4ac63b (patch)
treed38a8193c7e25ea677442ff4cec1af752ea1642c /usr/local/www/load_balancer_pool_edit.php
parent9859b2b5538192e64e650fc84e2a12ba4491d47c (diff)
downloadpfsense-0917cb214b2bbf7f4b374c901c642987fc4ac63b.zip
pfsense-0917cb214b2bbf7f4b374c901c642987fc4ac63b.tar.gz
load balancer: allow IPv4 subnets up to 64 addresses in Pools and Virtual Servers (PEV-394754)
Diffstat (limited to 'usr/local/www/load_balancer_pool_edit.php')
-rwxr-xr-xusr/local/www/load_balancer_pool_edit.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php
index d42e0b6..81a548c 100755
--- a/usr/local/www/load_balancer_pool_edit.php
+++ b/usr/local/www/load_balancer_pool_edit.php
@@ -94,15 +94,21 @@ if ($_POST) {
if (is_array($_POST['servers'])) {
foreach($pconfig['servers'] as $svrent) {
- if (!is_ipaddr($svrent)) {
- $input_errors[] = sprintf(gettext("%s is not a valid IP address (in \"enabled\" list)."), $svrent);
+ if (!is_ipaddr($svrent) && !is_subnetv4($svrent)) {
+ $input_errors[] = sprintf(gettext("%s is not a valid IP address or IPv4 subnet (in \"enabled\" list)."), $svrent);
+ }
+ else if (is_subnetv4($svrent) && subnet_size($svrent) > 64) {
+ $input_errors[] = sprintf(gettext("%s is a subnet containing more than 64 IP addresses (in \"enabled\" list)."), $svrent);
}
}
}
if (is_array($_POST['serversdisabled'])) {
foreach($pconfig['serversdisabled'] as $svrent) {
- if (!is_ipaddr($svrent)) {
- $input_errors[] = sprintf(gettext("%s is not a valid IP address (in \"disabled\" list)."), $svrent);
+ if (!is_ipaddr($svrent) && !is_subnetv4($svrent)) {
+ $input_errors[] = sprintf(gettext("%s is not a valid IP address or IPv4 subnet (in \"disabled\" list)."), $svrent);
+ }
+ else if (is_subnetv4($svrent) && subnet_size($svrent) > 64) {
+ $input_errors[] = sprintf(gettext("%s is a subnet containing more than 64 IP addresses (in \"disabled\" list)."), $svrent);
}
}
}
OpenPOWER on IntegriCloud