summaryrefslogtreecommitdiffstats
path: root/etc/rc.filter_synchronize
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-03-17 18:58:02 +0000
committerErmal <eri@pfsense.org>2011-03-17 18:58:02 +0000
commit3c69c52c1ce6953c3fa01f2ef2f957bd2c51ee64 (patch)
treeb708649982d09fa1ac930a2ad80f29c6a8218d90 /etc/rc.filter_synchronize
parent7e5f3edbf67907370c280330855ccbfc00802fec (diff)
downloadpfsense-3c69c52c1ce6953c3fa01f2ef2f957bd2c51ee64.zip
pfsense-3c69c52c1ce6953c3fa01f2ef2f957bd2c51ee64.tar.gz
Log the configuration is not the same error message only when this is true. This message would have been shown even when a communication error would occur.
Diffstat (limited to 'etc/rc.filter_synchronize')
-rwxr-xr-xetc/rc.filter_synchronize37
1 files changed, 18 insertions, 19 deletions
diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize
index ed80306..1dd0818 100755
--- a/etc/rc.filter_synchronize
+++ b/etc/rc.filter_synchronize
@@ -99,19 +99,19 @@ function carp_check_version($url, $password, $port = 80, $method = 'pfsense.host
$numberofruns = 0;
while ($numberofruns < 2) {
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $username = $config['system']['user'][0]['name'];
- $cli->setCredentials($username, $password);
- if($numberofruns > 1)
- $cli->setDebug(1);
- /* send our XMLRPC message and timeout after 240 seconds */
- $resp = $cli->send($msg, "240");
- if(!is_object($resp)) {
- $error = "A communications error occured while attempting XMLRPC sync with username {$username} {$url}:{$port}.";
- } elseif($resp->faultCode()) {
- $error = "An error code was received while attempting XMLRPC sync with username {$username} {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- } else {
+ $msg = new XML_RPC_Message($method, $params);
+ $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
+ $username = $config['system']['user'][0]['name'];
+ $cli->setCredentials($username, $password);
+ if($numberofruns > 1)
+ $cli->setDebug(1);
+ /* send our XMLRPC message and timeout after 240 seconds */
+ $resp = $cli->send($msg, "240");
+ if(!is_object($resp)) {
+ $error = "A communications error occured while attempting XMLRPC sync with username {$username} {$url}:{$port}.";
+ } elseif($resp->faultCode()) {
+ $error = "An error code was received while attempting XMLRPC sync with username {$username} {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
+ } else {
$parsed_response = XML_RPC_decode($resp->value());
if(!is_array($parsed_response)) {
if (trim($parsed_response) == "Authentication failed") {
@@ -122,9 +122,11 @@ function carp_check_version($url, $password, $port = 80, $method = 'pfsense.host
}
} else {
if (!isset($parsed_response['config_version']) ||
- $parsed_response['config_version'] < $config['version'])
+ $parsed_response['config_version'] < $config['version']) {
+ update_filter_reload_status("The other member is on older configuration version of {$g['product_name']}. Sync will not be done to prevent problems!");
+ log_error("The other member is on older configuration version of {$g['product_name']}. Sync will not be done to prevent problems!");
return false;
- else
+ } else
return true;
}
}
@@ -379,11 +381,8 @@ if (is_array($config['installedpackages']['carpsettings']['config'])) {
if ($carp['synchronizecaptiveportal'] != "" and is_array($config['vouchers']))
$sections[] = 'vouchers';
if (count($sections) > 0) {
- if (!carp_check_version($synchronizetoip, $carp['password'], $port)) {
- update_filter_reload_status("The other member is on older configuration version of {$g['product_name']}. Sync will not be done to prevent problems!");
- log_error("The other member is on older configuration version of {$g['product_name']}. Sync will not be done to prevent problems!");
+ if (!carp_check_version($synchronizetoip, $carp['password'], $port))
break;
- }
update_filter_reload_status("Signaling CARP reload signal...");
carp_sync_xml($synchronizetoip, $carp['password'], $sections, $port);
OpenPOWER on IntegriCloud