Always place 'nfacct' last

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-04-18 15:26:34 -07:00
parent d3e9a2f7e8
commit 9c010691a3

View File

@ -610,7 +610,8 @@ use constant { UNIQUE => 1,
EXCLUSIVE => 4,
MATCH => 8,
CONTROL => 16,
COMPLEX => 32
COMPLEX => 32,
LAST => 64,
};
our %opttype = ( rule => CONTROL,
@ -646,6 +647,8 @@ our %opttype = ( rule => CONTROL,
jump => TARGET,
target => TARGET,
targetopts => TARGET,
nfacct => LAST,
);
our %aliases = ( protocol => 'p',
@ -1014,6 +1017,10 @@ sub format_rule( $$;$ ) {
$rule .= format_option( $_, pop_match( $ruleref, $_ ) );
}
for ( grep( ( $opttype{$_} || 0 ) == LAST , @{$ruleref->{matches}} ) ) {
$rule .= format_option( $_, pop_match( $ruleref, $_ ) );
}
if ( $ruleref->{target} ) {
$rule .= join( ' ', " -$ruleref->{jump}", $ruleref->{target} );
$rule .= join( '', ' ', $ruleref->{targetopts} ) if $ruleref->{targetopts};