Ticket #471. Bring up the removed/unassigned interface correctly if it is parent to other interfaces, as vlans.

This commit is contained in:
Ermal 2010-04-27 21:31:46 +00:00
parent 461c0a1a4d
commit fa4a331fa5
2 changed files with 4 additions and 8 deletions

View File

@ -2798,16 +2798,11 @@ function link_interface_to_vlans($int, $action = "") {
if (empty($int))
return;
$real_if = get_real_interface($int);
if (is_array($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
if ($real_if == $vlan['if']) {
if ($int == $vlan['if']) {
if ($action == "update") {
foreach ($config['interfaces'] as $ifname => $ifcfg) {
if ($ifcfg['if'] == $vlan['vlanif'])
interface_vlan_configure($vlan);
interface_configure($ifname);
}
interfaces_bring_up($int);
} else if ($action == "")
return $vlan;
}

View File

@ -246,6 +246,7 @@ if ($_GET['act'] == "del") {
$input_errors[] = "The interface is part of a gif tunnel. Please delete the tunnel to continue";
else {
unset($config['interfaces'][$id]['enable']);
$realid = get_real_interface($id);
interface_bring_down($id); /* down the interface */
unset($config['interfaces'][$id]); /* delete the specified OPTn or LAN*/
@ -290,7 +291,7 @@ if ($_GET['act'] == "del") {
unset($config['dhcpd']['wan']);
}
link_interface_to_vlans($id, "update");
link_interface_to_vlans($realid, "update");
$savemsg = "Interface has been deleted.";
}