mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
GeoIP tweaks:
- Error if no CC - switch an 'if' expression to 'unless'. Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
43d882db2b
commit
0673898e85
@ -294,6 +294,7 @@ our %isocodes = (
|
|||||||
|
|
||||||
require_capability 'GEOIP_MATCH', 'The GeoIP action', 's';
|
require_capability 'GEOIP_MATCH', 'The GeoIP action', 's';
|
||||||
|
|
||||||
|
fatal_error "Missing Country Code(s)" unless $countries;
|
||||||
fatal_error "Invalid parameter ($audit) to action GeoIP" if supplied $audit && $audit ne 'audit';
|
fatal_error "Invalid parameter ($audit) to action GeoIP" if supplied $audit && $audit ne 'audit';
|
||||||
fatal_error "Invalid SRC/DST ($srcdst)" if supplied $srcdst && $srcdst !~ /^(src|dst)$/;
|
fatal_error "Invalid SRC/DST ($srcdst)" if supplied $srcdst && $srcdst !~ /^(src|dst)$/;
|
||||||
|
|
||||||
@ -315,7 +316,7 @@ $tag = $countries[0] unless $tag || @countries > 1;
|
|||||||
if ( $target ne '' ) {
|
if ( $target ne '' ) {
|
||||||
my $targettype = $targets{$target} || 0;
|
my $targettype = $targets{$target} || 0;
|
||||||
fatal_error "Unknown ACTION ($target)" unless $targettype;
|
fatal_error "Unknown ACTION ($target)" unless $targettype;
|
||||||
fatal_error "The $target action may not be passed to GeoIP" if ( ! $targettype & (STANDARD | CHAIN | ACTION ) ) || ( $targettype & ( NATRULE | NONAT ) );
|
fatal_error "The $target action may not be passed to GeoIP" unless ( $targettype & (STANDARD | CHAIN | ACTION ) ) && ! ( $targettype & ( NATRULE | NONAT ) );
|
||||||
|
|
||||||
if ( $level ne '' ) {
|
if ( $level ne '' ) {
|
||||||
my $chain1ref = ensure_filter_chain( newlogchain('filter' ), 0 );
|
my $chain1ref = ensure_filter_chain( newlogchain('filter' ), 0 );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user