diff options
author | Ermal <eri@pfsense.org> | 2013-12-07 23:07:24 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-12-13 22:58:48 +0000 |
commit | a1007e19cf9511a25db35f72593fde79801f67e4 (patch) | |
tree | 7660796109b3b32f5cee0c5b6590e61d6884039b /usr/local/www/firewall_virtual_ip_edit.php | |
parent | 92603e27d98bb89f63b2c0581f2fad2c39a9b09e (diff) | |
download | pfsense-a1007e19cf9511a25db35f72593fde79801f67e4.zip pfsense-a1007e19cf9511a25db35f72593fde79801f67e4.tar.gz |
Properly detect if an ip is already configured for VIP. Remove useless checks for carp
Diffstat (limited to 'usr/local/www/firewall_virtual_ip_edit.php')
-rwxr-xr-x | usr/local/www/firewall_virtual_ip_edit.php | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 05a65bb..5a822fc 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -1,3 +1,4 @@ +s_ipaddr_configured <?php /* $Id$ */ /* @@ -113,7 +114,7 @@ if ($_POST) { if ($_POST['subnet']) { if (!is_ipaddr($_POST['subnet'])) $input_errors[] = gettext("A valid IP address must be specified."); - else if (is_ipaddr_configured($_POST['subnet'], "vip_" . $id)) + else if (is_ipaddr_configured($_POST['subnet'], "{$_POST['interface']}_vip{$id}")) $input_errors[] = gettext("This IP address is being used by another interface or VIP."); } @@ -123,15 +124,6 @@ if ($_POST) { $input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP."); } - if(is_ipaddrv4($_POST['subnet'])) { - if(($_POST['subnet_bits'] == "31" or $_POST['subnet_bits'] == "32") and $_POST['mode'] == "carp") - $input_errors[] = gettext("The /31 and /32 subnet mask are invalid for CARP IPs."); - } - if(is_ipaddrv6($_POST['subnet'])) { - if(($_POST['subnet_bits'] == "127" or $_POST['subnet_bits'] == "128") and $_POST['mode'] == "carp") - $input_errors[] = gettext("The /127 and /128 subnet mask are invalid for CARP IPs."); - } - /* ipalias and carp should not use network or broadcast address */ if ($_POST['mode'] == "ipalias" || $_POST['mode'] == "carp") { if (is_ipaddrv4($_POST['subnet']) && $_POST['subnet_bits'] != "32") { |