mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-27 01:53:27 +01:00
Match section rules to the number of mark rules
This commit is contained in:
parent
251d7116c8
commit
1699d8e941
@ -1148,7 +1148,17 @@ sub finish_chain_section ($$) {
|
||||
|
||||
$comment = '';
|
||||
|
||||
add_rule $chainref, "-m state --state $state -j ACCEPT" unless $config{FASTACCEPT};
|
||||
unless ( $config{FASTACCEPT} ) {
|
||||
if ( $chainref->{marked} ) {
|
||||
if ( $chainref->{marked} == @{$chainref->{rules}} ) {
|
||||
insert_rule( $chainref, 0, "-m state --state $state -j ACCEPT" );
|
||||
} else {
|
||||
add_rule $chainref, "-m state --state $state -j ACCEPT";
|
||||
}
|
||||
} else {
|
||||
add_rule $chainref, "-m state --state $state -j ACCEPT";
|
||||
}
|
||||
}
|
||||
|
||||
if ($sections{NEW} ) {
|
||||
if ( $chainref->{is_policy} ) {
|
||||
|
@ -136,10 +136,8 @@ sub add_or_modify_policy_chain( $$ ) {
|
||||
my $mark = defined_zone( $zone )->{mark};
|
||||
my $mark1 = defined_zone( $zone1 )->{mark} << VIRTUAL_BITS;
|
||||
|
||||
add_rule $chainref, '-j MARK --or-mark ' . in_hex($mark) if $mark && $zone1 eq firewall_zone;
|
||||
add_rule $chainref, '-j MARK --or-mark ' . in_hex($mark1) if $mark1;
|
||||
|
||||
$chainref->{marked} = 1;
|
||||
$chainref->{marked} = 1, add_rule $chainref, '-j MARK --or-mark ' . in_hex($mark) if $mark && $zone1 eq firewall_zone;
|
||||
$chainref->{marked}++ , add_rule $chainref, '-j MARK --or-mark ' . in_hex($mark1) if $mark1;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user