Add accounting-rule sanity check

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8422 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-04-11 02:46:17 +00:00
parent 4c4b58d9cc
commit b1c5eefb6b

View File

@ -144,8 +144,6 @@ sub process_accounting_rule( $$$$$$$$$ ) {
my $chainref = ensure_accounting_chain $chain; my $chainref = ensure_accounting_chain $chain;
check_chain( $chainref );
expand_rule expand_rule
$chainref , $chainref ,
$restriction , $restriction ,
@ -179,6 +177,8 @@ sub setup_accounting() {
first_entry "$doing $fn..."; first_entry "$doing $fn...";
my $nonEmpty = 0;
while ( read_a_line ) { while ( read_a_line ) {
my ( $action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark ) = split_line1 1, 9, 'Accounting File'; my ( $action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark ) = split_line1 1, 9, 'Accounting File';
@ -186,10 +186,13 @@ sub setup_accounting() {
if ( $action eq 'COMMENT' ) { if ( $action eq 'COMMENT' ) {
process_comment; process_comment;
} else { } else {
$nonEmpty = 1;
process_accounting_rule $action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark; process_accounting_rule $action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark;
} }
} }
fatal_error "Accounring rules are isolated" if $nonEmpty && ! $filter_table->{accounting};
clear_comment; clear_comment;
if ( have_bridges ) { if ( have_bridges ) {