summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-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