diff options
author | Ermal <eri@pfsense.org> | 2013-12-18 13:50:31 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-12-18 13:50:31 +0000 |
commit | e7d35d846c0558a43e068dee7802f7708b4e0adf (patch) | |
tree | 37b5379ad080ad449b84170406d2e2561ba5f1d1 /etc/inc/upgrade_config.inc | |
parent | f3512fca87c1b682f336433d2922de78328bb9ac (diff) | |
download | pfsense-e7d35d846c0558a43e068dee7802f7708b4e0adf.zip pfsense-e7d35d846c0558a43e068dee7802f7708b4e0adf.tar.gz |
Convert ipaliases over carp to new world order
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r-- | etc/inc/upgrade_config.inc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 8f2104b..4dd2d6f 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -3264,4 +3264,31 @@ function upgrade_104_to_105() { } } +function upgrade_105_to_106() { + global $config; + + if (is_array($config['virtualip']) && is_array($config['virtualip']['vip'])) { + foreach ($config['virtualip']['vip'] as $vipidx => $vip) { + if ($vip['mode'] == "ipalias" && strstr("$vip['interface'], "_vip")) { + /* Convert to a carp with same properties as its carp version */ + $converted = false; + foreach ($config['virtualip']['vip'] as $bvip) { + if ($bvip['mode'] == "carp" && "{$bvip['interface']}_vip{$bvip['vhid']} == $vip['interface']) { + $ipaaddr = $vip['subnet']; + $ipamask = $vip['subnet_bits']; + $config['virtualip']['vip'][$vipidx] = $bvip; + $config['virtualip']['vip'][$vipidx]['subnet'] = $ipaaddr; + $config['virtualip']['vip'][$vipidx]['subnet_bits'] = $ipamask; + $converted = true; + break; + } + } + if ($converted === false) + log_error("WARNING: IPalias {$vip['subnet']}/{$vip['subnet_bits']} was not completed successfully. Upgrading it yourself is the only remaining option!"); + } + } + unset($vip, $bvip, $vipidx); + } +} + ?> |