Finish Mr-4's NFACCT patch

- Correct indentation
- Remove '$type' argument to split_nfacct_list
- Update manpages.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-04-23 06:55:30 -07:00
parent 68c7782e7d
commit f543c3bd1e
3 changed files with 28 additions and 24 deletions

View File

@ -138,10 +138,10 @@ sub process_section ($) {
$asection = $newsect;
}
sub split_nfacct_list( $$;$ ) {
my ($list, $type, $origlist ) = @_;
sub split_nfacct_list( $;$ ) {
my ($list, $origlist ) = @_;
fatal_error( "Invalid $type list (" . ( $origlist ? $origlist : $list ) . ')' ) if $list =~ /^,|,$|,,$/;
fatal_error( "Invalid nfacct list (" . ( $origlist ? $origlist : $list ) . ')' ) if $list =~ /^,|,$|,,$/;
split /,/, $list;
}
@ -234,16 +234,16 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) {
} elsif ( $action =~ /^NFACCT\(([\w,!]+)\)$/ ) {
require_capability 'NFACCT_MATCH', 'The NFACCT action', 's';
$target = '';
my @objects = split_nfacct_list $1, 'nfacct';
my @objects = split_nfacct_list $1;
for ( @objects ) {
if ( $_ =~ /^([\w]+)(!)?$/ ) {
if ( $2 ) {
$prerule .= "-m nfacct --nfacct-name $1 ";
} else {
$rule .= "-m nfacct --nfacct-name $1 ";
}
if ( $2 ) {
$prerule .= "-m nfacct --nfacct-name $1 ";
} else {
$rule .= "-m nfacct --nfacct-name $1 ";
}
} else {
accounting_error;
accounting_error;
}
}
} elsif ( $action eq 'INLINE' ) {

View File

@ -309,7 +309,7 @@
<varlistentry>
<term><emphasis
role="bold">NFACCT</emphasis>(<replaceable>object</replaceable>[,...])[!]</term>
role="bold">NFACCT</emphasis>({<replaceable>object</replaceable>[!]}[,...])</term>
<listitem>
<para>Added in Shorewall 4.5.7. Provides a form of accounting
@ -327,12 +327,14 @@
Beginning with Shorewall 4.5.16, an arbitrary number of
objects may be given.</para>
<para>With Shorewall 4.5.16 or later, <emphasis
role="bold">!</emphasis> may be specified to indicate that the
nfacct <replaceable>object</replaceable>(s) will be
incremented unconditionally. When omitted, the
<replaceable>object</replaceable>(s) will be incremented only
if all of the matches in the rule succeed.</para>
<para>With Shorewall 4.5.16 or later, an nfacct
<replaceable>object</replaceable> in the list may optionally
be followed by <emphasis role="bold">!</emphasis> to indicate
that the nfacct <replaceable>object</replaceable> will be
incremented unconditionally for each packet. When <emphasis
role="bold">!</emphasis> is omitted, the
<replaceable>object</replaceable> will be incremented only if
all of the matches in the rule succeed.</para>
</listitem>
</varlistentry>

View File

@ -251,7 +251,7 @@
<varlistentry>
<term><emphasis
role="bold">NFACCT</emphasis>(<replaceable>object</replaceable>[,...])[!]</term>
role="bold">NFACCT</emphasis>({<replaceable>object</replaceable>[!]}[,...])</term>
<listitem>
<para>Added in Shorewall 4.5.7. Provides a form of accounting
@ -269,12 +269,14 @@
Beginning with Shorewall 4.5.16, an arbitrary number of
objects may be given.</para>
<para>With Shorewall 4.5.16 or later, <emphasis
role="bold">!</emphasis> may be specified to indicate that the
nfacct <replaceable>object</replaceable>(s) will be
incremented unconditionally. When omitted, the
<replaceable>object</replaceable>(s) will be incremented only
if all of the matches in the rule succeed.</para>
<para>With Shorewall 4.5.16 or later, an nfacct
<replaceable>object</replaceable> in the list may optionally
be followed by <emphasis role="bold">!</emphasis> to indicate
that the nfacct <replaceable>object</replaceable> will be
incremented unconditionally for each packet. When <emphasis
role="bold">!</emphasis> is omitted, the
<replaceable>object</replaceable> will be incremented only if
all of the matches in the rule succeed.</para>
</listitem>
</varlistentry>