diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index d65898b5b..2d6f9b54a 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -2218,7 +2218,7 @@ sub reset_optflags( $$ ) { my $chainref = reftype $chain ? $chain : $filter_table->{$chain}; - $chainref->{optflags} ^= $flags; + $chainref->{optflags} ^= ( $flags & $chainref->{optflags} ); trace( $chainref, "O${flags}", undef, '' ) if $debug;