From a7af052d9176455e978eede434dca209df1a8a51 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 7 Jan 2013 16:07:24 -0800 Subject: [PATCH] Correct issue with generating ESTABLISHED rules. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index d90b6b498..122535d2a 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -884,20 +884,15 @@ sub finish_chain_section ($$$) { if ( $relatedchain ) { add_ijump $chainref, g => $related_target; + $state = ''; } else { add_ijump $chainref, g => $related_target, state_imatch 'RELATED'; + $state =~ s/,?RELATED//; } - - $state =~ s/,?RELATED//; } - - if ( $state && ! $config{FASTACCEPT} ) { - if ( $relatedchain ) { - add_ijump $chainref, j => 'ACCEPT'; - } else { - add_ijump $chainref, j => 'ACCEPT', state_imatch $state; - } + if ( $state ) { + add_ijump $chain1ref, j => 'ACCEPT', state_imatch $state unless $config{FASTACCEPT}; } if ($sections{NEW} ) {