summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-06-21 16:33:03 +0000
committerErmal <eri@pfsense.org>2010-06-21 16:33:26 +0000
commitbf02c78434cb5b3b5bec7a8c5b70ee12001641b7 (patch)
treec47f3abeb94c51728cc5712f87bcb16659141e3a /etc
parent52cf107d518e23cbd4d45a6aa0edac293dd7c27c (diff)
downloadpfsense-bf02c78434cb5b3b5bec7a8c5b70ee12001641b7.zip
pfsense-bf02c78434cb5b3b5bec7a8c5b70ee12001641b7.tar.gz
Fixes #480. Correctly upgrade config for monitorip. When a gateway exists save there the monitorip instead of the interface.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/upgrade_config.inc14
1 files changed, 9 insertions, 5 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 50b6ad0..104d5ac 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1619,6 +1619,9 @@ function upgrade_053_to_054() {
$lbpool_srv_arr = array();
$gateway_group_arr = array();
$gateways = return_gateways_array();
+ if (is_array($config['gateways']['gateway_item']))
+ $config['gateways']['gateway_item'] = array();
+ $a_gateways =& $config['gateways']['gateway_item'];
foreach($lbpool_arr as $lbpool) {
if($lbpool['type'] == "gateway") {
$gateway_group['name'] = $lbpool['name'];
@@ -1630,13 +1633,14 @@ function upgrade_053_to_054() {
$split = split("\|", $member);
$interface = $split[0];
$monitor = $split[1];
- if(is_ipaddr($monitor)) {
- $config['interfaces'][$interface]['monitorip'] = "$monitor";
- }
/* on static upgraded configuration we automatically prepend GW_ */
$static_name = "GW_" . strtoupper($interface);
- if(is_array($gateways[$static_name])) {
+ if(is_ipaddr($monitor)) {
$interface = $static_name;
+ if(is_array($gateways[$static_name]) && isset($gateways[$static_name]['attribute']))
+ $a_gateways[$gateways[$static_name]['attribute']]['monitor'] = $monitor;
+ else
+ $config['interfaces'][$interface]['monitorip'] = $monitor;
}
/* on failover increment tier. Else always assign 1 */
if($lbpool['behaviour'] == "failover") {
@@ -2064,4 +2068,4 @@ function upgrade_063_to_064() {
}
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud