diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-12-14 13:32:21 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-12-14 13:32:21 +0100 |
commit | da74e6735735155467eeaf9e9473b9d16c2a53fd (patch) | |
tree | eb8ca23eb9f0d44b9b9e78de73d582a1b7bb786e /etc/inc/upgrade_config.inc | |
parent | 54f8bad0f142ee0647775a0d2ecde79f1423b8af (diff) | |
download | pfsense-da74e6735735155467eeaf9e9473b9d16c2a53fd.zip pfsense-da74e6735735155467eeaf9e9473b9d16c2a53fd.tar.gz |
Fix the VLAN upgrade code so that it correctly renames the vlan entries and updates the interfaces
config section to the new name. Tested with 2 VLANS.
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r-- | etc/inc/upgrade_config.inc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index cd8c166..925c8a0 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -783,9 +783,19 @@ function upgrade_043_to_044() { function upgrade_044_to_045() { global $config; + $iflist = get_configured_interface_list(false, true); if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { - foreach ($config['vlans']['vlan'] as $id => $vlan) - $config['vlan']['vlan'][$id]['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; + foreach ($config['vlans']['vlan'] as $id => $vlan) { + $vlan['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; + $config['vlans']['vlan'][$id] = $vlan; + /* Make sure to update the interfaces section with the right name */ + foreach($iflist as $ifname) { + if($config['interfaces'][$ifname]['if'] == "vlan{$id}") { + $config['interfaces'][$ifname]['if'] = $vlan['vlanif']; + } + } + + } } } @@ -1791,4 +1801,4 @@ function upgrade_059_to_060() { } } -?>
\ No newline at end of file +?> |