forked from extern/shorewall_code
Finish rule emission change
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6945 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
0e555dcd57
commit
1fa2db41a1
@ -1830,13 +1830,6 @@ sub assure_cat_state() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub assure_cmd_state() {
|
|
||||||
unless ( $state == CMD_STATE ) {
|
|
||||||
emit_unindented "__EOF__\n" if $state == CAT_STATE;
|
|
||||||
$state = CMD_STATE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Emits the passed rule (input to iptables-restore) or command
|
# Emits the passed rule (input to iptables-restore) or command
|
||||||
#
|
#
|
||||||
@ -1847,10 +1840,19 @@ sub emitr( $ ) {
|
|||||||
#
|
#
|
||||||
# A command rather than a rule
|
# A command rather than a rule
|
||||||
#
|
#
|
||||||
assure_cmd_state;
|
unless ( $state == CMD_STATE ) {
|
||||||
|
emit_unindented "__EOF__\n" if $state == CAT_STATE;
|
||||||
|
$state = CMD_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
emit $rule;
|
emit $rule;
|
||||||
} else {
|
} else {
|
||||||
assure_cat_state;
|
unless ( $state == CAT_STATE ) {
|
||||||
|
emit '';
|
||||||
|
emit 'cat >&3 << __EOF__';
|
||||||
|
$state = CAT_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
emit_unindented $rule;
|
emit_unindented $rule;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1915,8 +1917,9 @@ sub create_netfilter_load() {
|
|||||||
push @table_list, 'mangle' if $capabilities{MANGLE_ENABLED};
|
push @table_list, 'mangle' if $capabilities{MANGLE_ENABLED};
|
||||||
push @table_list, 'filter';
|
push @table_list, 'filter';
|
||||||
|
|
||||||
for my $table ( @table_list ) {
|
|
||||||
assure_cat_state;
|
assure_cat_state;
|
||||||
|
|
||||||
|
for my $table ( @table_list ) {
|
||||||
emit_unindented "*$table";
|
emit_unindented "*$table";
|
||||||
|
|
||||||
my @chains;
|
my @chains;
|
||||||
|
Loading…
Reference in New Issue
Block a user