diff --git a/Shorewall/Perl/Shorewall/Accounting.pm b/Shorewall/Perl/Shorewall/Accounting.pm index 8c14df928..f30e25347 100644 --- a/Shorewall/Perl/Shorewall/Accounting.pm +++ b/Shorewall/Perl/Shorewall/Accounting.pm @@ -237,9 +237,9 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) { for ( my @objects = split_nfacct_list $1 ) { validate_nfobject( $_, 1 ); if ( s/!$// ) { - $prerule .= "-m nfacct --nfacct-name $_ "; + $prerule .= do_nfacct( $_ ); } else { - $rule .= "-m nfacct --nfacct-name $_ "; + $rule .= do_nfacct( $_ ); } } } elsif ( $action eq 'INLINE' ) { diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 165bb6b0a..a15a20548 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -211,6 +211,7 @@ our %EXPORT_TAGS = ( do_probability do_condition do_dscp + do_nfacct have_ipset_rules record_runtime_address verify_address_variables @@ -5175,6 +5176,13 @@ sub do_dscp( $ ) { "-m dscp ${invert}--dscp $value "; } +# +# Return nfacct match +# +sub do_nfacct( $ ) { + "-m nfacct --nfacct-name @_ "; +} + # # Match Source Interface # @@ -5453,7 +5461,7 @@ sub match_source_net( $;$\$ ) { require_capability 'NFACCT_MATCH', "An nfacct object list ($3)", 's'; for ( my @objects = split_list $3, 'nfacct' ) { validate_nfobject( $_ ); - $result .= "-m nfacct --nfacct-name $_ "; + $result .= do_nfacct( $_ ); } } @@ -5473,7 +5481,7 @@ sub match_source_net( $;$\$ ) { require_capability 'NFACCT_MATCH', "An nfacct object list ($3)", 's'; for ( my @objects = split_list $3, 'nfacct' ) { validate_nfobject( $_ ); - $result .= "-m nfacct --nfacct-name $_ "; + $result .= do_nfacct( $_ ); } } } @@ -5627,7 +5635,7 @@ sub match_dest_net( $;$ ) { require_capability 'NFACCT_MATCH', "An nfacct object list ($3)", 's'; for ( my @objects = split_list $3, 'nfacct' ) { validate_nfobject( $_ ); - $result .= "-m nfacct --nfacct-name $_ "; + $result .= do_nfacct( $_ ); } } @@ -5649,7 +5657,7 @@ sub match_dest_net( $;$ ) { require_capability 'NFACCT_MATCH', "An nfacct object list ($3)", 's'; for ( my @objects = split_list $3, 'nfacct' ) { validate_nfobject( $_ ); - $result .= "-m nfacct --nfacct-name $_ "; + $result .= do_nfacct( $_ ); } }