1
0

Use '@{0}' as the chain name surrogate in SWITCH columns

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-11-29 07:17:13 -08:00
parent bff91cd325
commit 9c0d8a2533
6 changed files with 29 additions and 9 deletions

View File

@ -4654,9 +4654,9 @@ sub do_condition( $$ ) {
require_capability 'CONDITION_MATCH', 'A non-empty SWITCH column', 's'; require_capability 'CONDITION_MATCH', 'A non-empty SWITCH column', 's';
if ( $condition =~ /@/ ) { if ( $condition =~ /\@\{0\}/ ) {
$chain =~ s/[^\w-]//g; $chain =~ s/[^\w-]//g;
$condition =~ s/@/$chain/g; $condition =~ s/\@\{0\}/$chain/g;
} }
fatal_error "Invalid switch name ($condition)" unless $condition =~ /^[a-zA-Z][-\w]*$/ && length $condition <= 30; fatal_error "Invalid switch name ($condition)" unless $condition =~ /^[a-zA-Z][-\w]*$/ && length $condition <= 30;

View File

@ -397,7 +397,11 @@
<filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename> <filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename>
is 1. The rule is disabled if that file contains 0 (the default). If is 1. The rule is disabled if that file contains 0 (the default). If
'!' is supplied, the test is inverted such that the rule is enabled '!' is supplied, the test is inverted such that the rule is enabled
if the file contains 0. <replaceable>switch-name</replaceable> must if the file contains 0.</para>
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
replaced by the name of the chain to which the rule is a added. The
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
begin with a letter and be composed of letters, decimal digits, begin with a letter and be composed of letters, decimal digits,
underscores or hyphens. Switch names must be 30 characters or less underscores or hyphens. Switch names must be 30 characters or less
in length.</para> in length.</para>

View File

@ -471,7 +471,11 @@
<filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename> <filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename>
is 1. The rule is disabled if that file contains 0 (the default). If is 1. The rule is disabled if that file contains 0 (the default). If
'!' is supplied, the test is inverted such that the rule is enabled '!' is supplied, the test is inverted such that the rule is enabled
if the file contains 0. <replaceable>switch-name</replaceable> must if the file contains 0.</para>
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
replaced by the name of the chain to which the rule is a added. The
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
begin with a letter and be composed of letters, decimal digits, begin with a letter and be composed of letters, decimal digits,
underscores or hyphens. Switch names must be 30 characters or less underscores or hyphens. Switch names must be 30 characters or less
in length.</para> in length.</para>

View File

@ -1380,7 +1380,11 @@
<filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename> <filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename>
is 1. The rule is disabled if that file contains 0 (the default). If is 1. The rule is disabled if that file contains 0 (the default). If
'!' is supplied, the test is inverted such that the rule is enabled '!' is supplied, the test is inverted such that the rule is enabled
if the file contains 0. <replaceable>switch-name</replaceable> must if the file contains 0.</para>
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
replaced by the name of the chain to which the rule is a added. The
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
begin with a letter and be composed of letters, decimal digits, begin with a letter and be composed of letters, decimal digits,
underscores or hyphens. Switch names must be 30 characters or less underscores or hyphens. Switch names must be 30 characters or less
in length.</para> in length.</para>

View File

@ -293,8 +293,12 @@
<filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename> <filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename>
is 1. Disables the rule if that file contains 0 (the default). If is 1. Disables the rule if that file contains 0 (the default). If
'!' is supplied, the test is inverted such that the rule is enabled '!' is supplied, the test is inverted such that the rule is enabled
if the file contains 0. The <replaceable>switch-name</replaceable> if the file contains 0.</para>
must begin with a letter and be composed of letters, decimal digits,
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
replaced by the name of the chain to which the rule is a added. The
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
begin with a letter and be composed of letters, decimal digits,
underscores or hyphens. Switch names must be 30 characters or less underscores or hyphens. Switch names must be 30 characters or less
in length.</para> in length.</para>

View File

@ -1255,8 +1255,12 @@
<filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename> <filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename>
is 1. Disables the rule if that file contains 0 (the default). If is 1. Disables the rule if that file contains 0 (the default). If
'!' is supplied, the test is inverted such that the rule is enabled '!' is supplied, the test is inverted such that the rule is enabled
if the file contains 0. The <replaceable>switch-name</replaceable> if the file contains 0.</para>
must begin with a letter and be composed of letters, decimal digits,
<para>Within the <replaceable>switch-name</replaceable>, '@{0}' is
replaced by the name of the chain to which the rule is a added. The
<replaceable>switch-name</replaceable> (after '@{0}' expansion) must
begin with a letter and be composed of letters, decimal digits,
underscores or hyphens. Switch names must be 30 characters or less underscores or hyphens. Switch names must be 30 characters or less
in length.</para> in length.</para>