summaryrefslogtreecommitdiffstats
path: root/usr/local/www/xmlrpc.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-05-18 21:31:35 +0000
committerErmal <eri@pfsense.org>2011-05-18 21:31:35 +0000
commitf51d4f989eaa8d1e943c6cbf68faae499cddc961 (patch)
tree1ac7fe02a4a93414c865dffcb39a5d83fb796957 /usr/local/www/xmlrpc.php
parent516114406bd88d6eda76c958f40c38aac263a4a1 (diff)
downloadpfsense-f51d4f989eaa8d1e943c6cbf68faae499cddc961.zip
pfsense-f51d4f989eaa8d1e943c6cbf68faae499cddc961.tar.gz
Ticket #1534, #1433. Remove custom sync code for vip, since it array_merge() replaces same keys data when merging. But make the code for reloading only changed vips after merge better and some more checks.
Diffstat (limited to 'usr/local/www/xmlrpc.php')
-rwxr-xr-xusr/local/www/xmlrpc.php22
1 files changed, 8 insertions, 14 deletions
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index 55fac86..7ddbfc6 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -158,6 +158,7 @@ function restore_config_section_xmlrpc($raw_params) {
$params = xmlrpc_params_to_php($raw_params);
if(!xmlrpc_auth($params))
return $xmlrpc_g['return']['authfail'];
+
$vipbackup = array();
$oldvips = array();
if (isset($params[0]['virtualip'])) {
@@ -170,25 +171,18 @@ function restore_config_section_xmlrpc($raw_params) {
}
}
}
+
// For vip section, first keep items sent from the master
$config = array_merge($config, $params[0]);
- /*
- * NOTE: Do not rely on array_merge since it might keep vips in there if there were
- * many vips previously and only a reduced list is sent for synching.
- */
- if (is_array($params[0]['virtualip']) && is_array($params[0]['virtualip']['vip'])) {
+ /* Then add ipalias and proxyarp types already defined on the backup */
+ if (is_array($vipbackup) && !empty($vipbackup)) {
if (!is_array($config['virtualip']))
$config['virtualip'] = array();
- $config['virtualip'] = $params[0]['virtualip'];
- } else
- $config['virtualip'] = array(); // Reset
-
- /* Then add ipalias and proxyarp types already defined on the backup */
- if (is_array($vipbackup)) {
- foreach ($vipbackup as $vip) {
+ if (!is_array($config['virtualip']['vip']))
+ $config['virtualip']['vip'] = array();
+ foreach ($vipbackup as $vip)
array_unshift($config['virtualip']['vip'], $vip);
- }
}
/* Log what happened */
@@ -201,7 +195,7 @@ function restore_config_section_xmlrpc($raw_params) {
*/
if (is_array($config['virtualip']) && is_array($config['virtualip']['vip'])) {
$carp_setuped = false;
- $anyproxyarp = false;
+ $anyproxyarp = false;
foreach ($config['virtualip']['vip'] as $vip) {
if (isset($oldvips[$vip['vhid']])) {
if ($oldvips[$vip['vhid']] == "{$vip['password']}{$vip['advskew']}{$vip['subnet']}{$vip['subnet_bits']}{$vip['advbase']}") {
OpenPOWER on IntegriCloud