mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-14 11:44:01 +01:00
Remove duplicate interface names in generated case statement.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
384c179dd6
commit
e12bc47546
@ -221,10 +221,21 @@ sub copy_and_edit_table( $$$$ ) {
|
||||
my ( $duplicate, $number, $copy, $realm) = @_;
|
||||
|
||||
my $filter = $family == F_IPV6 ? q(fgrep -v ' cache ' | sed 's/ via :: / /' | ) : '';
|
||||
my %copied;
|
||||
my @copy;
|
||||
#
|
||||
# Remove duplicates
|
||||
#
|
||||
for ( split ',', $copy ) {
|
||||
unless ( $copied{$_} ) {
|
||||
push @copy, $_;
|
||||
$copied{$_} = 1;
|
||||
}
|
||||
}
|
||||
#
|
||||
# Map physical names in $copy to logical names
|
||||
#
|
||||
$copy = join( '|' , map( physical_name($_) , split( ',' , $copy ) ) );
|
||||
$copy = join( '|' , map( physical_name($_) , @copy ) );
|
||||
#
|
||||
# Shell and iptables use a different wildcard character
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user