From 2217f899023ce8f85e57811129267650b82a1752 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 28 Jan 2013 07:40:26 -0800 Subject: [PATCH] Correctly initialize $chainref->{sections} vis-a-vis FASTACCEPT. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 83fe0cd26..3d8fb81aa 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -232,7 +232,17 @@ sub initialize( $ ) { # sub new_rules_chain( $ ) { my $chainref = new_chain( 'filter', $_[0] ); - $chainref->{sections} = $config{FASTACCEPT} ? { RELATED => 1, ESTABLISHED => 1 } : {}; + + if ( $config{FASTACCEPT} ) { + if ( $globals{RELATED_TARGET} eq 'ACCEPT' && ! $config{RELATED_LOG_LEVEL} ) { + $chainref->{sections} = { ESTABLISHED => 1, RELATED => 1 }; + } else { + $chainref->{sections} = { ESTABLISHED => 1 }; + } + } else { + $chainref->{sections} = {}; + } + $chainref; }