summaryrefslogtreecommitdiffstats
path: root/usr/local/www/load_balancer_virtual_server_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_virtual_server_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_virtual_server_edit.php')
-rwxr-xr-xusr/local/www/load_balancer_virtual_server_edit.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/local/www/load_balancer_virtual_server_edit.php b/usr/local/www/load_balancer_virtual_server_edit.php
index 7a2d792..ff59fd9 100755
--- a/usr/local/www/load_balancer_virtual_server_edit.php
+++ b/usr/local/www/load_balancer_virtual_server_edit.php
@@ -91,8 +91,10 @@ if ($_POST) {
if (!is_port($_POST['port']))
$input_errors[] = gettext("The port must be an integer between 1 and 65535.");
- if(!is_ipaddr($_POST['ipaddr']))
- $input_errors[] = sprintf(gettext("%s is not a valid IP address."), $_POST['ipaddr']);
+ if (!is_ipaddr($_POST['ipaddr']) && !is_subnetv4($_POST['ipaddr']))
+ $input_errors[] = sprintf(gettext("%s is not a valid IP address or IPv4 subnet."), $_POST['ipaddr']);
+ else if (is_subnetv4($_POST['ipaddr']) && subnet_size($_POST['ipaddr']) > 64)
+ $input_errors[] = sprintf(gettext("%s is a subnet containing more than 64 IP addresses."), $_POST['ipaddr']);
if (!$input_errors) {
$vsent = array();
OpenPOWER on IntegriCloud