diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-06-07 01:07:53 +0200 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-06-07 01:07:53 +0200 |
commit | 0105ae3d0fa3b509f7ed08132670bcfd790a16f4 (patch) | |
tree | 0443d13e680d359ba342a76b8f27c18760e8fc25 /etc/inc/upgrade_config.inc | |
parent | 2523c9231878ff2d001129a7273075674d09034a (diff) | |
download | pfsense-0105ae3d0fa3b509f7ed08132670bcfd790a16f4.zip pfsense-0105ae3d0fa3b509f7ed08132670bcfd790a16f4.tar.gz |
Add bridge upgrade code for 1.2 -> 2.0
Like the vlan upgrade code this uses slot 38 to make sure it will not run on a 2.0 configuration.
This is blind coded and needs testing. Please help testing.
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r-- | etc/inc/upgrade_config.inc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 460c77e..f039f38 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -585,7 +585,32 @@ function upgrade_036_to_037() { function upgrade_037_to_038() { global $config; - /* Insert upgrade code here */ + + /* This should only be valid when upgrading bridges from a 1.2 config */ + $a_bridges = array(); + $counter = 0; + foreach($config['interfaces'] as & $interface => $name) { + if($interface['bridge'] <> "") { + $bridge = array(); + $bridge['members'] = "{$name},{$interface['bridge']}"; + $bridge['descr'] = "Upgraded from 1.2" + $bridge['maxaddr'] = ""; + $bridge['timeout'] = ""; + $bridge['maxage'] = ""; + $bridge['fwdelay'] = ""; + $bridge['hellotime'] = ""; + $bridge['priority'] = ""; + $bridge['proto'] = "rstp"; + $bridge['holdcount'] = ""; + $bridge['ifpriority'] = ""; + $bridge['ifpathcost'] = ""; + $bridge['bridgeif'] = "bridge{$counter}"; + /* done collecting info, have to burn those bridges */ + $config['interfaces'][$name]['bridge'] = true; + $a_bridges[] = $bridge; + } + } + $config['bridges'] = $a_bridges; } |