Minor cleanup of the Chains module

- Correct typos
- Correct 'P' trace entries
- Add parens and comments to calls

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-08-15 09:22:11 -07:00
parent bcacce7ed0
commit 31d35e0cbd
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -3485,7 +3485,7 @@ sub optimize_level4( $$ ) {
$progress = 1; $progress = 1;
} elsif ( $chainref->{builtin} || ! $globals{KLUDGEFREE} || $firstrule->{policy} ) { } elsif ( $chainref->{builtin} || ! $globals{KLUDGEFREE} || $firstrule->{policy} ) {
# #
# This case requires a new rule merging algorithm. Ignore this chain for # This case requires a new rule merging algorithm. Ignore this chain from
# now on. # now on.
# #
$chainref->{optflags} |= DONT_OPTIMIZE; $chainref->{optflags} |= DONT_OPTIMIZE;
@ -3493,7 +3493,7 @@ sub optimize_level4( $$ ) {
# #
# Replace references to this chain with the target and add the matches # Replace references to this chain with the target and add the matches
# #
$progress = 1 if replace_references1 $chainref, $firstrule; $progress = 1 if replace_references1( $chainref, $firstrule );
} }
} }
} else { } else {
@ -3539,7 +3539,7 @@ sub optimize_level4( $$ ) {
#empty builtin chain -- change it's policy #empty builtin chain -- change it's policy
# #
$chainref->{policy} = $target; $chainref->{policy} = $target;
trace( $chainref, 'P', undef, 'ACCEPT' ) if $debug; trace( $chainref, 'P', undef, $target ) if $debug;
$count++; $count++;
} }
@ -3693,7 +3693,12 @@ sub optimize_level8( $$$ ) {
if ( $chainref->{digest} eq $chainref1->{digest} ) { if ( $chainref->{digest} eq $chainref1->{digest} ) {
progress_message " Chain $chainref1->{name} combined with $chainref->{name}"; progress_message " Chain $chainref1->{name} combined with $chainref->{name}";
$progress = 1; $progress = 1;
replace_references $chainref1, $chainref->{name}, undef, '', '', 1; replace_references( $chainref1,
$chainref->{name},
undef, # Target Opts
'', # Comment
'', # Origin
1 ); # Recalculate digests of modified chains
unless ( $chainref->{name} =~ /^~/ || $chainref1->{name} =~ /^%/ ) { unless ( $chainref->{name} =~ /^~/ || $chainref1->{name} =~ /^%/ ) {
# #