summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2011-03-16 08:46:42 +0100
committersmos <seth.mos@dds.nl>2011-03-16 08:46:42 +0100
commit323f3f9c17d9307ab9eb820cbd05cc7629ce80b9 (patch)
treed728b04e5668edbdd89d0770487e0477dd374f7c /etc
parente58da189b45242c57ba8b186c0209087cfa67c11 (diff)
downloadpfsense-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')
-rw-r--r--etc/inc/upgrade_config.inc9
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']}";
OpenPOWER on IntegriCloud