diff options
author | Ermal <eri@pfsense.org> | 2013-11-28 18:36:03 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-11-28 18:36:18 +0000 |
commit | 7238e0cfc840d175e5b0dd650730fc21b6a9b368 (patch) | |
tree | 7a3b20dd35ddf6019eb61f612d10711de12c03e4 /usr | |
parent | d11134243489f7cea17cdc4c04a0624b0c16ed18 (diff) | |
download | pfsense-7238e0cfc840d175e5b0dd650730fc21b6a9b368.zip pfsense-7238e0cfc840d175e5b0dd650730fc21b6a9b368.tar.gz |
Remove references to _vip interface and provide proper configuration for carp on FreeBSD 10. Still some places to deal with this and certainly missing upgrade code
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/carp_status.php | 6 | ||||
-rwxr-xr-x | usr/local/www/firewall_virtual_ip.php | 7 | ||||
-rwxr-xr-x | usr/local/www/firewall_virtual_ip_edit.php | 21 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/carp_status.widget.php | 4 | ||||
-rwxr-xr-x | usr/local/www/xmlrpc.php | 5 |
5 files changed, 6 insertions, 37 deletions
diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 9749063..d01e746 100755 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -75,10 +75,6 @@ if($_POST['disablecarp'] <> "") { interface_carp_configure($vip); sleep(1); break; - case "ipalias": - if (strstr($vip['interface'], "_vip")) - interface_ipalias_configure($vip); - break; } } } @@ -152,7 +148,7 @@ include("head.inc"); $vhid = $carp['vhid']; $advskew = $carp['advskew']; $advbase = $carp['advbase']; - $carp_int = "{$carp['interface']}_vip{$vhid}"; + $carp_int = get_real_interface($carp['interface']); $status = get_carp_interface_status($carp_int); echo "<tr>"; $align = "valign='middle'"; diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php index 3a3cb3d..86f0c85 100755 --- a/usr/local/www/firewall_virtual_ip.php +++ b/usr/local/www/firewall_virtual_ip.php @@ -157,14 +157,7 @@ if ($_GET['act'] == "del") { if ($found_carp === true && $found_other_alias === false) $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by a CARP IP with the description") . " {$vip['descr']}."; - } else if ($a_vip[$_GET['id']]['mode'] == "carp") { - $vipiface = "{$a_vip[$_GET['id']]['interface']}_vip{$a_vip[$_GET['id']]['vhid']}"; - foreach ($a_vip as $vip) { - if ($vipiface == $vip['interface'] && $vip['mode'] == "ipalias") - $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by an IP alias entry with the description") . " {$vip['descr']}."; - } } - if (!$input_errors) { if (!session_id()) diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index b9993d4..81e4bb3 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -180,31 +180,10 @@ if ($_POST) { if ($_POST['interface'] == "lo0") $input_errors[] = gettext("For this type of vip localhost is not allowed."); - if (strstr($_POST['interface'], "_vip")) - $input_errors[] = gettext("For this type of vip a carp parent is not allowed."); - break; - case "ipalias": - if (strstr($_POST['interface'], "_vip")) { - if (is_ipaddrv4($_POST['subnet'])) { - $parent_ip = get_interface_ip($_POST['interface']); - $parent_sn = get_interface_subnet($_POST['interface']); - $subnet = gen_subnet($parent_ip, $parent_sn); - } else if (is_ipaddrv6($_POST['subnet'])) { - $parent_ip = get_interface_ipv6($_POST['interface']); - $parent_sn = get_interface_subnetv6($_POST['interface']); - $subnet = gen_subnetv6($parent_ip, $parent_sn); - } - if (isset($parent_ip) && !ip_in_subnet($_POST['subnet'], "{$subnet}/{$parent_sn}") && !ip_in_interface_alias_subnet($_POST['interface'], $_POST['subnet'])) { - $cannot_find = $_POST['subnet'] . "/" . $_POST['subnet_bits'] ; - $input_errors[] = sprintf(gettext("Sorry, we could not locate an interface with a matching subnet for %s. Please add an IP alias in this subnet on this interface."),$cannot_find); - } - } break; default: if ($_POST['interface'] == "lo0") $input_errors[] = gettext("For this type of vip localhost is not allowed."); - if (strstr($_POST['interface'], "_vip")) - $input_errors[] = gettext("For this type of VIP, a CARP parent is not allowed."); break; } diff --git a/usr/local/www/widgets/widgets/carp_status.widget.php b/usr/local/www/widgets/widgets/carp_status.widget.php index 1710d1b..a7c55e8 100644 --- a/usr/local/www/widgets/widgets/carp_status.widget.php +++ b/usr/local/www/widgets/widgets/carp_status.widget.php @@ -49,7 +49,7 @@ $carp_enabled = get_carp_status(); $netmask = $carp['subnet_bits']; $vhid = $carp['vhid']; $advskew = $carp['advskew']; - $carp_int = "{$carp['interface']}_vip{$vhid}"; + $carp_int = get_real_interface($carp['interface']); $status = get_carp_interface_status($carp_int); ?> <tr> @@ -79,4 +79,4 @@ $carp_enabled = get_carp_status(); } else { ?> <tr><td class="listr">No CARP Interfaces Defined. Click <a href="carp_status.php">here</a> to configure CARP.</td></tr> <?php } ?> -</table>
\ No newline at end of file +</table> diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index e011162..91f05e9 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -269,8 +269,9 @@ function restore_config_section_xmlrpc($raw_params) { } /* Cleanup remaining old carps */ foreach ($oldvips as $oldvipif => $oldvippar) { - if (!is_ipaddr($oldvipif) && does_interface_exist($oldvipif)) - pfSense_interface_destroy($oldvipif); + $oldvipif = get_real_interface($oldvippar['interface']); + if (!empty($oldvipif)) + pfSense_interface_deladdress($oldvipif, $oldvipar['subnet']); } if ($carp_setuped == true) interfaces_carp_setup(); |