mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-24 23:28:59 +01:00
Minor tweak to blacklisting
Reverse order of tests for 'from' and 'src'. Use equivalent logic for generating unknown option error Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
5ab6f8e0e5
commit
166d27f6d4
@ -260,7 +260,7 @@ sub setup_blacklist() {
|
|||||||
my $tgt = $whitelist ? 'RETURN' : $target;
|
my $tgt = $whitelist ? 'RETURN' : $target;
|
||||||
|
|
||||||
for ( @options ) {
|
for ( @options ) {
|
||||||
if ( $_ =~ /^(?:from|src)$/ ) {
|
if ( $_ =~ /^(?:src|from)$/ ) {
|
||||||
if ( $from++ ) {
|
if ( $from++ ) {
|
||||||
warning_message "Duplicate 'src' ignored";
|
warning_message "Duplicate 'src' ignored";
|
||||||
} else {
|
} else {
|
||||||
@ -300,8 +300,8 @@ sub setup_blacklist() {
|
|||||||
warning_message '"dst" entry ignored because there are no "blacklist out" zones';
|
warning_message '"dst" entry ignored because there are no "blacklist out" zones';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elsif ( $_ ne 'whitelist' ) {
|
} else {
|
||||||
fatal_error "Invalid blacklist option($_)";
|
fatal_error "Invalid blacklist option($_)" unless $_ eq 'whitelist';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user