summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2009-06-07 01:07:53 +0200
committerSeth Mos <seth.mos@xs4all.nl>2009-06-07 01:07:53 +0200
commit0105ae3d0fa3b509f7ed08132670bcfd790a16f4 (patch)
tree0443d13e680d359ba342a76b8f27c18760e8fc25
parent2523c9231878ff2d001129a7273075674d09034a (diff)
downloadpfsense-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.
-rw-r--r--etc/inc/upgrade_config.inc27
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;
}
OpenPOWER on IntegriCloud