diff options
author | jim-p <jimp@pfsense.org> | 2012-09-26 13:20:39 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-09-26 13:20:39 -0400 |
commit | 6e9b046e51f5728b8d8f0182b401476059040d1d (patch) | |
tree | 911aacf1b1623c1ca876b2d7f721b196f450e734 /etc | |
parent | fd3515f2b78184125e0f16a4a991660003ff7cd0 (diff) | |
download | pfsense-6e9b046e51f5728b8d8f0182b401476059040d1d.zip pfsense-6e9b046e51f5728b8d8f0182b401476059040d1d.tar.gz |
Due to the DHCP pool tag needing to be an array, rename the old LB "pool" variable to something else so it's not interpreted as an array.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/globals.inc | 2 | ||||
-rw-r--r-- | etc/inc/upgrade_config.inc | 17 | ||||
-rw-r--r-- | etc/inc/vslb.inc | 16 |
3 files changed, 26 insertions, 9 deletions
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index 23c3a92..51fbc22 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -77,7 +77,7 @@ $g = array( "disablecrashreporter" => false, "crashreporterurl" => "http://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, - "latest_config" => "8.9", + "latest_config" => "9.0", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "101", "minimum_ram_warning_text" => "128 MB", diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index f7ae95d..4f66a8b 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -905,6 +905,8 @@ function upgrade_045_to_046() { $pool['behaviour'] = 'balance'; $pool['name'] = "{$vs_a[$i]['name']}-sitedown"; $pool['descr'] = sprintf(gettext("Sitedown pool for VS: %s"), $vs_a[$i]['name']); + if (is_array($vs_a[$i]['pool'])) + $vs_a[$i]['pool'] = $vs_a[$i]['pool'][0]; $pool['port'] = $pools[$vs_a[$i]['pool']]['port']; $pool['servers'] = array(); $pool['servers'][] = $vs_a[$i]['sitedown']; @@ -2930,4 +2932,19 @@ function upgrade_088_to_089() { } } } +function upgrade_089_to_090() { + global $config; + if (is_array($config['load_balancer']['virtual_server']) && count($config['load_balancer']['virtual_server'])) { + $vs_a = &$config['load_balancer']['virtual_server']; + for ($i = 0; isset($vs_a[$i]); $i++) { + if (is_array($vs_a[$i]['pool'])) { + $vs_a[$i]['poolname'] = $vs_a[$i]['pool'][0]; + unset($vs_a[$i]['pool']); + } elseif (!empty($vs_a[$i]['pool'])) { + $vs_a[$i]['poolname'] = $vs_a[$i]['pool']; + unset($vs_a[$i]['pool']); + } + } + } +} ?> diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc index 0a975f0..1aed862 100644 --- a/etc/inc/vslb.inc +++ b/etc/inc/vslb.inc @@ -267,12 +267,12 @@ function relayd_configure($kill_first=false) { for ($i = 0; isset($vs_a[$i]); $i++) { $append_port_to_name = false; - if (is_alias($pools[$vs_a[$i]['pool']]['port'])) { - $dest_port_array = filter_expand_alias_array($pools[$vs_a[$i]['pool']]['port']); + if (is_alias($pools[$vs_a[$i]['poolname']]['port'])) { + $dest_port_array = filter_expand_alias_array($pools[$vs_a[$i]['poolname']]['port']); $append_port_to_name = true; } else { - $dest_port_array = array($pools[$vs_a[$i]['pool']]['port']); + $dest_port_array = array($pools[$vs_a[$i]['poolname']]['port']); } if (is_alias($vs_a[$i]['port'])) { $src_port_array = filter_expand_alias_array($vs_a[$i]['port']); @@ -331,26 +331,26 @@ function relayd_configure($kill_first=false) { $conf .= " protocol \"{$vs_a[$i]['relay_protocol']}\"\n"; } $lbmode = ""; - if ( $pools[$vs_a[$i]['pool']]['mode'] == "loadbalance" ) { + if ( $pools[$vs_a[$i]['poolname']]['mode'] == "loadbalance" ) { $lbmode = "mode loadbalance"; } - $conf .= " forward to <{$vs_a[$i]['pool']}> port {$dest_port} {$lbmode} {$check_a[$pools[$vs_a[$i]['pool']]['monitor']]} \n"; + $conf .= " forward to <{$vs_a[$i]['poolname']}> port {$dest_port} {$lbmode} {$check_a[$pools[$vs_a[$i]['poolname']]['monitor']]} \n"; if (isset($vs_a[$i]['sitedown']) && strlen($vs_a[$i]['sitedown']) > 0) - $conf .= " forward to <{$vs_a[$i]['sitedown']}> port {$dest_port} {$lbmode} {$check_a[$pools[$vs_a[$i]['pool']]['monitor']]} \n"; + $conf .= " forward to <{$vs_a[$i]['sitedown']}> port {$dest_port} {$lbmode} {$check_a[$pools[$vs_a[$i]['poolname']]['monitor']]} \n"; $conf .= "}\n"; } else { $conf .= "redirect \"{$name}\" {\n"; $conf .= " listen on {$ip} port {$src_port}\n"; - $conf .= " forward to <{$vs_a[$i]['pool']}> port {$dest_port} {$check_a[$pools[$vs_a[$i]['pool']]['monitor']]} \n"; + $conf .= " forward to <{$vs_a[$i]['poolname']}> port {$dest_port} {$check_a[$pools[$vs_a[$i]['poolname']]['monitor']]} \n"; if (isset($config['system']['lb_use_sticky'])) $conf .= " sticky-address\n"; /* sitedown MUST use the same port as the primary pool - sucks, but it's a relayd thing */ if (isset($vs_a[$i]['sitedown']) && strlen($vs_a[$i]['sitedown']) > 0) - $conf .= " forward to <{$vs_a[$i]['sitedown']}> port {$dest_port} {$check_a[$pools[$vs_a[$i]['pool']]['monitor']]} \n"; + $conf .= " forward to <{$vs_a[$i]['sitedown']}> port {$dest_port} {$check_a[$pools[$vs_a[$i]['poolname']]['monitor']]} \n"; $conf .= "}\n"; } |