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:
Tom Eastep 2011-05-18 11:13:03 -07:00
parent 5ab6f8e0e5
commit 166d27f6d4

View File

@ -260,7 +260,7 @@ sub setup_blacklist() {
my $tgt = $whitelist ? 'RETURN' : $target;
for ( @options ) {
if ( $_ =~ /^(?:from|src)$/ ) {
if ( $_ =~ /^(?:src|from)$/ ) {
if ( $from++ ) {
warning_message "Duplicate 'src' ignored";
} else {
@ -300,8 +300,8 @@ sub setup_blacklist() {
warning_message '"dst" entry ignored because there are no "blacklist out" zones';
}
}
} elsif ( $_ ne 'whitelist' ) {
fatal_error "Invalid blacklist option($_)";
} else {
fatal_error "Invalid blacklist option($_)" unless $_ eq 'whitelist';
}
}