diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-03-16 10:03:29 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-03-16 10:03:29 +0100 |
commit | bfc0cb5b6af67cda4c29580ad9fe51c9cda197e5 (patch) | |
tree | 3d63c281f8161a77e12ce8144a05d3f8fab57f81 /etc | |
parent | 85071ea22b22b70b1d3955cf131e4646cf3d818c (diff) | |
parent | 323f3f9c17d9307ab9eb820cbd05cc7629ce80b9 (diff) | |
download | pfsense-bfc0cb5b6af67cda4c29580ad9fe51c9cda197e5.zip pfsense-bfc0cb5b6af67cda4c29580ad9fe51c9cda197e5.tar.gz |
Merge remote branch 'upstream/master'
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/config.lib.inc | 7 | ||||
-rw-r--r-- | etc/inc/upgrade_config.inc | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index 2edcea3..11e1ec3 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -397,12 +397,17 @@ function convert_config() { include_once('auth.inc'); include_once('upgrade_config.inc'); + if (file_exists("/etc/inc/upgrade_config_custom.inc")) + include_once("upgrade_config_custom.inc"); /* Loop and run upgrade_VER_to_VER() until we're at current version */ while ($config['version'] < $g['latest_config']) { $cur = $config['version'] * 10; $next = $cur + 1; $migration_function = sprintf('upgrade_%03d_to_%03d', $cur, $next); $migration_function(); + $migration_function = "{$migration_function}_custom"; + if (function_exists($migration_function)) + $migration_function(); $config['version'] = sprintf('%.1f', $next / 10); if($g['booting']) echo "."; @@ -847,4 +852,4 @@ function set_device_perms() { } } -?>
\ No newline at end of file +?> diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 0177461..1e1fe13 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -790,6 +790,7 @@ function upgrade_043_to_044() { $gateways = return_gateways_array(true); $i = 0; if (is_array($config['staticroutes']['route'])) { + $gwmap = array(); foreach ($config['staticroutes']['route'] as $idx => $sroute) { $found = false; foreach ($gateways as $gwname => $gw) { @@ -799,9 +800,15 @@ function upgrade_043_to_044() { break; } } + if($gwmap[$sroute['gateway']]) { + /* We already added a gateway name for this IP */ + $config['staticroutes']['route'][$idx]['gateway'] = "{$gwmap[$sroute['gateway']]}"; + $found = true; + } if ($found == false) { $gateway = array(); - $gateway['name'] = "SROUTE{$i}"; + $gateway['name'] = "SROUTE{$i}"; + $gwmap[$sroute['gateway']] = $gateway['name']; $gateway['gateway'] = $sroute['gateway']; $gateway['interface'] = $sroute['interface']; $gateway['descr'] = "Upgraded static route for {$sroute['network']}"; |