forked from extern/shorewall_code
Somehow, this got left behind.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
0669c6cbc5
commit
1c23276cb0
@ -1386,6 +1386,9 @@ sub replace_references( $$ ) {
|
||||
my ( $chainref, $target ) = @_;
|
||||
my $table = $chainref->{table};
|
||||
my $count = 0;
|
||||
my $name = $chainref->{name};
|
||||
|
||||
$name =~ s/\+/\\+/;
|
||||
|
||||
if ( defined $chain_table{$table}{$target} && ! $chain_table{$table}{$target}{builtin} ) {
|
||||
#
|
||||
@ -1394,7 +1397,7 @@ sub replace_references( $$ ) {
|
||||
for my $fromref ( map $chain_table{$table}{$_} , keys %{$chainref->{references}} ) {
|
||||
if ( $fromref->{referenced} ) {
|
||||
for ( @{$fromref->{rules}} ) {
|
||||
if ( defined && s/ -([jg]) $chainref->{name}(\b)/ -$1 ${target}$2/ ) {
|
||||
if ( defined && s/ -([jg]) $name(\b)/ -$1 ${target}$2/ ) {
|
||||
add_reference( $fromref, $chain_table{$table}{$target} );
|
||||
$count++;
|
||||
}
|
||||
@ -1407,7 +1410,7 @@ sub replace_references( $$ ) {
|
||||
#
|
||||
for my $fromref ( map $chain_table{$table}{$_} , keys %{$chainref->{references}} ) {
|
||||
if ( $fromref->{referenced} ) {
|
||||
defined && s/ -[jg] $chainref->{name}(\b)/ -j ${target}$1/ && $count++ for @{$fromref->{rules}};
|
||||
defined && s/ -[jg] $name(\b)/ -j ${target}$1/ && $count++ for @{$fromref->{rules}};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1425,6 +1428,9 @@ sub replace_references1( $$$ ) {
|
||||
my ( $chainref, $target, $matches ) = @_;
|
||||
my $table = $chainref->{table};
|
||||
my $count = 0;
|
||||
my $name = $chainref->{name};
|
||||
|
||||
$name =~ s/\+/\\+/;
|
||||
#
|
||||
# Note: If $matches is non-empty, then it begins with white space
|
||||
#
|
||||
@ -1435,12 +1441,12 @@ sub replace_references1( $$$ ) {
|
||||
for my $fromref ( map $chain_table{$table}{$_} , keys %{$chainref->{references}} ) {
|
||||
if ( $fromref->{referenced} ) {
|
||||
for ( @{$fromref->{rules}} ) {
|
||||
if ( defined && /^-A $fromref->{name} .*-[jg] $chainref->{name}\b/ ) {
|
||||
if ( defined && /^-A $name .*-[jg] $chainref->{name}\b/ ) {
|
||||
#
|
||||
# Prevent multiple '-p' matches
|
||||
#
|
||||
s/ -p [^ ]+ / / if / -p / && $matches =~ / -p /;
|
||||
s/\s+-([jg]) $chainref->{name}(\b)/$matches -$1 ${target}$2/;
|
||||
s/\s+-([jg]) $name(\b)/$matches -$1 ${target}$2/;
|
||||
add_reference( $fromref, $chain_table{$table}{$target} );
|
||||
$count++;
|
||||
}
|
||||
@ -1454,12 +1460,12 @@ sub replace_references1( $$$ ) {
|
||||
for my $fromref ( map $chain_table{$table}{$_} , keys %{$chainref->{references}} ) {
|
||||
if ( $fromref->{referenced} ) {
|
||||
for ( @{$fromref->{rules}} ) {
|
||||
if ( defined && /^-A $fromref->{name} .*-[jg] $chainref->{name}\b/ ) {
|
||||
if ( defined && /^-A $name .*-[jg] $chainref->{name}\b/ ) {
|
||||
#
|
||||
# Prevent multiple '-p' matches
|
||||
#
|
||||
s/ -p [^ ]+ / / if / -p / && $matches =~ / -p /;
|
||||
s/\s+-[jg] $chainref->{name}(\b)/$matches -j ${target}$1/;
|
||||
s/\s+-[jg] $name(\b)/$matches -j ${target}$1/;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user