From 0ee17602a5e26f88b8ebef47d9743cdc1702735e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Mon, 5 Oct 2009 20:07:52 +0000 Subject: Correctly handle the change of vhid on an interface. --- usr/local/www/firewall_virtual_ip.php | 3 +-- usr/local/www/firewall_virtual_ip_edit.php | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php index dd4dd2c..96d5047 100755 --- a/usr/local/www/firewall_virtual_ip.php +++ b/usr/local/www/firewall_virtual_ip.php @@ -101,8 +101,7 @@ if ($_GET['act'] == "del") { } if (!$input_errors) { - if ($a_vip[$_GET['id']]['type'] == "ipalias") - mwexec("/sbin/ifconfig " . get_real_interface($a_vip[$_GET['id']]['interface']) . " delete {$a_vip[$_GET['id']]['subnet']}"); + interface_vip_bring_down($a_vip[$_GET['id']]); unset($a_vip[$_GET['id']]); write_config(); mark_subsystem_dirty('vip'); diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 6503047..e670a5d 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -143,6 +143,9 @@ if ($_POST) { $input_errors[] = "Sorry, we could not locate an interface with a matching subnet for {$cannot_find}. Please add an IP alias in this subnet on this interface."; } else if ($parent_sn != $_POST['subnet_bits']) $input_errors[] = "Subnet bits needs to be the same as the parent interface."; + + if ($a_vip[$id]['vhid'] != $_POST['vhid']) + interface_vip_bring_down($a_vip[$id]); } if (!$input_errors) { -- cgit v1.1