More log level changes

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6113 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-04-25 00:19:55 +00:00
parent 3a67b4f76c
commit 140dd95130
3 changed files with 7 additions and 6 deletions

View File

@ -462,6 +462,7 @@ sub new_chain($$)
$ch{log} = 1 if $globals{LOGRULENUMBERS};
$ch{rules} = [];
$ch{table} = $table;
$ch{loglevel} = '';
$chain_table{$table}{$chain} = \%ch;
\%ch;
}

View File

@ -205,7 +205,7 @@ sub validate_policy()
push @policy_chains, ( $chainref );
}
$chainref->{loglevel} = $loglevel if $loglevel;
$chainref->{loglevel} = $loglevel if defined $loglevel && $loglevel ne '';
$chainref->{synparams} = $synparams if $synparams;
$chainref->{default} = $default if $default;
@ -243,7 +243,7 @@ sub policy_rules( $$$$ ) {
add_rule $chainref, "-j $default" if $default && $default ne 'none';
log_rule $loglevel , $chainref , $target , '' if $loglevel;
log_rule $loglevel , $chainref , $target , '' if $loglevel ne '';
fatal_error "Null target in policy_rules()" unless $target;

View File

@ -249,7 +249,7 @@ sub setup_syn_flood_chains() {
my $synchainref = new_chain 'filter' , syn_chain $chainref->{name};
add_rule $synchainref , "-m limit --limit $limit ${burst}-j RETURN";
log_rule_limit $level , $synchainref , $chainref->{name} , 'DROP', '-m limit --limit 5/min --limit-burst 5' , '' , 'add' , ''
if defined $level && $level ne '';
if $level ne '';
add_rule $synchainref, '-j DROP';
}
}
@ -1171,7 +1171,7 @@ sub process_rule ( $$$$$$$$$ ) {
if ( ( ( my $policy ) = $policychainref->{policy} ) ne 'NONE' ) {
if ( $optimize > 0 ) {
my $loglevel = $policychainref->{loglevel};
if ( defined $loglevel && $loglevel ne '' ) {
if ( $loglevel ne '' ) {
next if $target eq "${policy}:$loglevel}";
} else {
next if $action eq $policy;
@ -1191,7 +1191,7 @@ sub process_rule ( $$$$$$$$$ ) {
if ( ( ( my $policy ) = $policychainref->{policy} ) ne 'NONE' ) {
if ( $optimize > 0 ) {
my $loglevel = $policychainref->{loglevel};
if ( defined $loglevel && $loglevel ne '') {
if ( $loglevel ne '') {
next if $target eq "${policy}:$loglevel}";
} else {
next if $action eq $policy;
@ -1212,7 +1212,7 @@ sub process_rule ( $$$$$$$$$ ) {
if ( ( ( my $policy ) = $policychainref->{policy} ) ne 'NONE' ) {
if ( $optimize > 0 ) {
my $loglevel = $policychainref->{loglevel};
if ( defined $loglevel && $loglevel ne '' ) {
if ( $loglevel ne '' ) {
next if $target eq "${policy}:$loglevel}";
} else {
next if $action eq $policy;