diff options
author | smos <seth.mos@dds.nl> | 2011-03-16 08:46:42 +0100 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2011-03-16 08:46:42 +0100 |
commit | 323f3f9c17d9307ab9eb820cbd05cc7629ce80b9 (patch) | |
tree | d728b04e5668edbdd89d0770487e0477dd374f7c /etc/inc/upgrade_config.inc | |
parent | e58da189b45242c57ba8b186c0209087cfa67c11 (diff) | |
download | pfsense-323f3f9c17d9307ab9eb820cbd05cc7629ce80b9.zip pfsense-323f3f9c17d9307ab9eb820cbd05cc7629ce80b9.tar.gz |
Keep a table of gateways we added for static routes to prevent us from making multiple entries to the same IP address
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r-- | etc/inc/upgrade_config.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index f09b9bb..268f903 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']}"; |