summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-01-28 23:56:49 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-01-28 23:56:49 +0000
commit3b7abf1c4a141723f2163d98c604a180bf1f122f (patch)
tree2da65edfafd40964cf1bfcc4a6f623b7b6c71bd3
parentee9551786b7f12569da0b15bcfca656250150eae (diff)
downloadpfsense-3b7abf1c4a141723f2163d98c604a180bf1f122f.zip
pfsense-3b7abf1c4a141723f2163d98c604a180bf1f122f.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.
-rwxr-xr-xusr/local/www/firewall_virtual_ip_edit.php8
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 86025bc..aa90378 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'] ;
OpenPOWER on IntegriCloud