diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 26a9b5607..a09a7474c 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -878,10 +878,10 @@ sub finish_chain_section ($$$) { if ( $state && ! $config{FASTACCEPT} ) { - if ( $chainref->{name} eq $chain1ref->{name} ) { - add_ijump $chainref, j => 'ACCEPT', state_imatch $state; - } else { + if ( $relatedchain ) { add_ijump $chainref, j => 'ACCEPT'; + } else { + add_ijump $chainref, j => 'ACCEPT', state_imatch $state; } }