Take care of cleaning the ip alias when we delete an entry of ipalias type or modify it.

This commit is contained in:
Ermal Lui 2009-03-26 17:15:41 +00:00
parent 2064fb9dc3
commit 53af883529
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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'])