Project

General

Profile

Actions

Bug #38

closed

Malfunctioning of 'No XMLRPC Sync' code, causing some rules to still get synced to CARP members

Added by Wouter de Jong about 15 years ago. Updated about 15 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
Rules / NAT
Target version:
Start date:
07/04/2009
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
All
Affected Architecture:

Description

Bug #26 [[http://redmine.pfsense.org/issues/show/26]] is Resolved,
not sure if my update get's it picked up again, hence this new ticket.

I am in a situation (can provide access to the machines in question if wanted)
where I can consistently reproduce a problem with the nosync flag,
causing some rules to still get synced to CARP members.

Running the sample code provided below with 'php test.php' on a pfSense 1.2.3 snapshot
(at least since the February snapshots and including the 2009-07-18-1920 snapshot),
correctly removes (unset) rule#35, rule#36 and rule#37 but keeps rule#38 and rule#39, despite their nosync flag !!!
This exactly mimics the situation I have with pfSense.

Maybe this is a PHP bug ?

Sample code :

<?php

$config_copy['nat']['rule'][0]['desc']          = 'rule 0';
$config_copy['nat']['rule'][1]['desc']          = 'rule 1';
$config_copy['nat']['rule'][2]['desc']          = 'rule 2';
$config_copy['nat']['rule'][3]['desc']          = 'rule 3';
$config_copy['nat']['rule'][4]['desc']          = 'rule 4';
$config_copy['nat']['rule'][5]['desc']          = 'rule 5';
$config_copy['nat']['rule'][6]['desc']          = 'rule 6';
$config_copy['nat']['rule'][7]['desc']          = 'rule 7';
$config_copy['nat']['rule'][8]['desc']          = 'rule 8';
$config_copy['nat']['rule'][9]['desc']          = 'rule 9';
$config_copy['nat']['rule'][10]['desc']         = 'rule 10';
$config_copy['nat']['rule'][11]['desc']         = 'rule 11';
$config_copy['nat']['rule'][12]['desc']         = 'rule 12';
$config_copy['nat']['rule'][13]['desc']         = 'rule 13';
$config_copy['nat']['rule'][14]['desc']         = 'rule 14';
$config_copy['nat']['rule'][15]['desc']         = 'rule 15';
$config_copy['nat']['rule'][16]['desc']         = 'rule 16';
$config_copy['nat']['rule'][17]['desc']         = 'rule 17';
$config_copy['nat']['rule'][18]['desc']         = 'rule 18';
$config_copy['nat']['rule'][19]['desc']         = 'rule 19';
$config_copy['nat']['rule'][20]['desc']         = 'rule 20';
$config_copy['nat']['rule'][21]['desc']         = 'rule 21';
$config_copy['nat']['rule'][22]['desc']         = 'rule 22';
$config_copy['nat']['rule'][23]['desc']         = 'rule 23';
$config_copy['nat']['rule'][24]['desc']         = 'rule 24';
$config_copy['nat']['rule'][25]['desc']         = 'rule 25';
$config_copy['nat']['rule'][26]['desc']         = 'rule 26';
$config_copy['nat']['rule'][27]['desc']         = 'rule 27';
$config_copy['nat']['rule'][28]['desc']         = 'rule 28';
$config_copy['nat']['rule'][29]['desc']         = 'rule 29';
$config_copy['nat']['rule'][30]['desc']         = 'rule 30';
$config_copy['nat']['rule'][31]['desc']         = 'rule 31';
$config_copy['nat']['rule'][32]['desc']         = 'rule 32';
$config_copy['nat']['rule'][33]['desc']         = 'rule 33';
$config_copy['nat']['rule'][34]['desc']         = 'rule 34';
$config_copy['nat']['rule'][35]['desc']         = 'rule 35';
$config_copy['nat']['rule'][35]['nosync']       = '';
$config_copy['nat']['rule'][36]['desc']         = 'rule 36';
$config_copy['nat']['rule'][36]['nosync']       = '';
$config_copy['nat']['rule'][37]['desc']         = 'rule 37';
$config_copy['nat']['rule'][37]['nosync']       = '';
$config_copy['nat']['rule'][38]['desc']         = 'rule 38';
$config_copy['nat']['rule'][38]['nosync']       = '';
$config_copy['nat']['rule'][39]['desc']         = 'rule 39';
$config_copy['nat']['rule'][39]['nosync']       = '';

print("COUNT: ".count($config_copy['nat']['rule']))."\n";
for($x=0;$x<count($config_copy['nat']['rule']);$x++) {
        if(isset($config_copy['nat']['rule'][$x]['nosync'])) {
                unset($config_copy['nat']['rule'][$x]);
        }
}
print_r($config_copy);
?>
Actions

Also available in: Atom PDF