From 53af8835299dd4c55ddf035e43fc8930cff31469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Thu, 26 Mar 2009 17:15:41 +0000 Subject: [PATCH] Take care of cleaning the ip alias when we delete an entry of ipalias type or modify it. --- usr/local/www/firewall_virtual_ip.php | 2 ++ usr/local/www/firewall_virtual_ip_edit.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php index c1f212cf70..d0e05eb7bf 100755 --- a/usr/local/www/firewall_virtual_ip.php +++ b/usr/local/www/firewall_virtual_ip.php @@ -90,6 +90,8 @@ 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']}"); unset($a_vip[$_GET['id']]); write_config(); touch($d_vipconfdirty_path); diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 37e59f7e94..52029b5804 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -195,6 +195,8 @@ if ($_POST) { } if (isset($id) && $a_vip[$id]) { + if ($_POST['mode'] == "ipalias") + mwexec("/sbin/ifconfig " . get_real_interface($a_vip[$id]['interface']) . " delete {$a_vip[$id]['subnet']}"); /* modify all virtual IP rules with this address */ for ($i = 0; isset($config['nat']['rule'][$i]); $i++) { if ($config['nat']['rule'][$i]['external-address'] == $a_vip[$id]['subnet'])