diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-01-28 23:56:55 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-01-28 23:56:55 +0000 |
commit | 0882c6d2395499810d56d08e3f6d51caccbb5aeb (patch) | |
tree | 46779054b2ac9a669510097333632e58830ab39f /usr/local | |
parent | 1dfc6c56fb2e0bd20b2809172d3387f3b0025e6d (diff) | |
download | pfsense-0882c6d2395499810d56d08e3f6d51caccbb5aeb.zip pfsense-0882c6d2395499810d56d08e3f6d51caccbb5aeb.tar.gz |
Use ip_in_subnet() to correctly determineif we have a matching real ip
address defined somewhere before allowing the CARP address to be added.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/firewall_virtual_ip_edit.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 29827b4..f52529d 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -132,12 +132,10 @@ if ($_POST) { for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) $iflist['opt' . $i] = 'opt' . $i; foreach($iflist as $if) { - $ww_subnet_ip = return_first_two_octets($config['interfaces'][$if]['ipaddr']); - $ww_subnet_bits = return_first_two_octets($config['interfaces'][$if]['subnet']); - if($ww_subnet_ip == $subnet_ip and $ww_subnet_bits == $_POST['subnet_bits']) { + $ww_subnet_ip = $config['interfaces'][$if]['ipaddr']; + $ww_subnet_bits = $config['interfaces'][$if]['subnet']; + if (ip_in_subnet($_POST['subnet'], gen_subnet($ww_subnet_ip, $ww_subnet_bits) . "/" . $ww_subnet_bits)) $found = true; - break; - } } if($found == false) { $cannot_find = $_POST['subnet'] . "/" . $_POST['subnet_bits'] ; |