mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 15:43:30 +01:00
Normalize parameters by removing trailing omitted args
- Avoids needless duplicate action chains
This commit is contained in:
parent
4a0a906510
commit
53adfbe863
@ -1312,8 +1312,18 @@ sub normalize_action( $$$ ) {
|
||||
# Note: SNAT actions store the current interface's name in the tag
|
||||
#
|
||||
$tag = '' unless defined $tag;
|
||||
$param = '' unless defined $param;
|
||||
$param = '' if $param eq '-';
|
||||
|
||||
if ( defined( $param ) ) {
|
||||
#
|
||||
# Normalize the parameters by removing trailing omitted
|
||||
# parameters
|
||||
#
|
||||
1 while $param =~ s/,-$//;
|
||||
|
||||
$param = '' if $param eq '-';
|
||||
} else {
|
||||
$param = '';
|
||||
}
|
||||
|
||||
join( ':', $action, $level, $tag, $caller, $param );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user