From 3d0397011cbc467982950400ac3e5b5a0cd93eff Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 23 Feb 2011 15:07:04 +0100 Subject: Make sure we iterate by the vlan number lest we end up with a empty variable? Hopefully fix new vlan name not being assigned to interfaces section --- etc/inc/upgrade_config.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index c52ec8f..cc8042a 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -820,15 +820,16 @@ function upgrade_044_to_045() { global $config; $iflist = get_configured_interface_list(false, true); if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { + $i = 0; foreach ($config['vlans']['vlan'] as $id => $vlan) { - $config['vlans']['vlan'][$id]['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; + $config['vlans']['vlan'][$i]['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; /* Make sure to update the interfaces section with the right name */ foreach($iflist as $ifname) { - if($config['interfaces'][$ifname]['if'] == "vlan{$id}") { + if($config['interfaces'][$ifname]['if'] == "vlan{$i}") { $config['interfaces'][$ifname]['if'] = $vlan['vlanif']; } } - + $i++; } } } -- cgit v1.1