From 6b78bed77784dd0fe823ba67019cfb899ed38f68 Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 27 Dec 2010 15:09:11 +0000 Subject: Ticket #944. Wehn changing the parent interface make sure to destroy the old vlan before creating the new one. Since vlans use the name of the parent the old interface referencing the old parent vlan will remain intact. --- usr/local/www/interfaces_vlan_edit.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'usr/local/www/interfaces_vlan_edit.php') diff --git a/usr/local/www/interfaces_vlan_edit.php b/usr/local/www/interfaces_vlan_edit.php index 447722a..f548386 100755 --- a/usr/local/www/interfaces_vlan_edit.php +++ b/usr/local/www/interfaces_vlan_edit.php @@ -102,6 +102,11 @@ if ($_POST) { $vlan['descr'] = $_POST['descr']; $vlan['vlanif'] = "{$_POST['if']}_vlan{$_POST['tag']}"; + if (isset($id) && $a_vlans[$id]) { + if ($a_vlans[$id]['if'] != $_POST['if']) + // Destroy previous vlan + interface_bring_down($a_vlans[$id]['if'], true); + } $vlan['vlanif'] = interface_vlan_configure($vlan); if ($vlan['vlanif'] == "" || !stristr($vlan['vlanif'], "vlan")) $input_errors[] = gettext("Error occured creating interface, please retry."); -- cgit v1.1