summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-05-25 05:45:24 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-05-25 05:45:24 +0000
commit2db680e1ab7c9bcd0eb8c9724caf62ad2b287011 (patch)
tree23807a865a9f738df97315a6edd68f7eea382ff1 /usr
parent3d33b09e81d66fca13943a1b4ad3a20bf939610d (diff)
downloadpfsense-2db680e1ab7c9bcd0eb8c9724caf62ad2b287011.zip
pfsense-2db680e1ab7c9bcd0eb8c9724caf62ad2b287011.tar.gz
Output CarpDEV-DHCP items correctly. Do not have subnet-bits.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/firewall_virtual_ip.php8
-rwxr-xr-xusr/local/www/firewall_virtual_ip_edit.php13
2 files changed, 12 insertions, 9 deletions
diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php
index a6b4c0c..d50ef10 100755
--- a/usr/local/www/firewall_virtual_ip.php
+++ b/usr/local/www/firewall_virtual_ip.php
@@ -139,18 +139,20 @@ include("head.inc");
</tr>
<?php $i = 0; foreach ($a_vip as $vipent): ?>
<?php if($vipent['subnet'] <> "" or $vipent['range'] <> "" or
- $vipent['subnet_bits'] <> "" or $vipent['range']['from'] <> ""): ?>
+ $vipent['subnet_bits'] <> "" or $vipent['range']['from'] <> "" or $vipent['mode'] == "carpdev-dhcp"): ?>
<tr>
<td class="listlr" ondblclick="document.location='firewall_virtual_ip_edit.php?id=<?=$i;?>';">
<?php if (($vipent['type'] == "single") || ($vipent['type'] == "network"))
- echo "{$vipent['subnet']}/{$vipent['subnet_bits']}";
+ if($vipent['subnet_bits'])
+ echo "{$vipent['subnet']}/{$vipent['subnet_bits']}";
if ($vipent['type'] == "range")
echo "{$vipent['range']['from']}-{$vipent['range']['to']}";
?>
<?php if($vipent['mode'] == "carp") echo " (vhid {$vipent['vhid']})"; ?>
+ <?php if($vipent['mode'] == "carpdev-dhcp") echo "DHCP"; ?>
</td>
<td class="listlr" align="center" ondblclick="document.location='firewall_virtual_ip_edit.php?id=<?=$i;?>';">
- <? if($vipent['mode'] == "proxyarp") echo "<img src='./themes/".$g['theme']."/images/icons/icon_parp.gif' title='Proxy ARP'>"; elseif($vipent['mode'] == "carp") echo "<img src='./themes/".$g['theme']."/images/icons/icon_carp.gif' title='CARP'>"; elseif($vipent['mode'] == "other") echo "<img src='./themes/".$g['theme']."/images/icons/icon_other.gif' title='Other'>"; elseif($vipent['mode'] == "ipalias") echo "<img src='./themes/".$g['theme']."/images/icons/icon_ipalias.gif' title='IP Alias'>";?>
+ <? if($vipent['mode'] == "proxyarp") echo "<img src='./themes/".$g['theme']."/images/icons/icon_parp.gif' title='Proxy ARP'>"; elseif($vipent['mode'] == "carp" or $vipent['mode'] == "carpdev-dhcp") echo "<img src='./themes/".$g['theme']."/images/icons/icon_carp.gif' title='CARP'>"; elseif($vipent['mode'] == "other") echo "<img src='./themes/".$g['theme']."/images/icons/icon_other.gif' title='Other'>"; elseif($vipent['mode'] == "ipalias") echo "<img src='./themes/".$g['theme']."/images/icons/icon_ipalias.gif' title='IP Alias'>";?>
</td>
<td class="listbg" ondblclick="document.location='firewall_virtual_ip_edit.php?id=<?=$i;?>';">
<font color="#FFFFFF"><?=htmlspecialchars($vipent['descr']);?>&nbsp;
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php
index 3470dad..1d5036a 100755
--- a/usr/local/www/firewall_virtual_ip_edit.php
+++ b/usr/local/www/firewall_virtual_ip_edit.php
@@ -109,11 +109,6 @@ if ($_POST) {
}
}
}
-
- if ($_POST['mode'] == "carpdev-dhcp") {
- unset($_POST['subnet']);
- unset($_POST['subnet_bits']);
- }
/* make sure new ip is within the subnet of a valid ip
* on one of our interfaces (wan, lan optX)
@@ -187,6 +182,12 @@ if ($_POST) {
$vipent['subnet'] = $_POST['subnet'];
}
+ if ($_POST['mode'] == "carpdev-dhcp") {
+ unset($vipent['subnet']);
+ unset($vipent['subnet_bits']);
+ unset($vipent['alias-subnet']);
+ }
+
if (isset($id) && $a_vip[$id]) {
/* modify all virtual IP rules with this address */
for ($i = 0; isset($config['nat']['rule'][$i]); $i++) {
@@ -198,7 +199,7 @@ if ($_POST) {
$a_vip[] = $vipent;
touch($d_vipconfdirty_path);
-
+
write_config();
header("Location: firewall_virtual_ip.php");
OpenPOWER on IntegriCloud