mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-19 21:01:20 +01:00
Re-order logic in add_group_to_zone
- Need to normalize the address prior to comparing it with ALLIP Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
880e63064b
commit
54e066ec3a
@ -764,6 +764,13 @@ sub add_group_to_zone($$$$$)
|
|||||||
$new = \@exclusions;
|
$new = \@exclusions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( substr( $host, 0, 1 ) eq '+' ) {
|
||||||
|
fatal_error "Invalid ipset name ($host)" unless $host =~ /^\+(6_)?[a-zA-Z][-\w]*$/;
|
||||||
|
require_capability( 'IPSET_MATCH', 'Ipset names in host lists', '');
|
||||||
|
} else {
|
||||||
|
$host = validate_host $host, 0;
|
||||||
|
}
|
||||||
|
|
||||||
unless ( $switched ) {
|
unless ( $switched ) {
|
||||||
if ( $type == $zonetype ) {
|
if ( $type == $zonetype ) {
|
||||||
fatal_error "Duplicate Host Group ($interface:$host) in zone $zone" if $interfaces{$interface}{zone} eq $zone;
|
fatal_error "Duplicate Host Group ($interface:$host) in zone $zone" if $interfaces{$interface}{zone} eq $zone;
|
||||||
@ -782,13 +789,6 @@ sub add_group_to_zone($$$$$)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( substr( $host, 0, 1 ) eq '+' ) {
|
|
||||||
fatal_error "Invalid ipset name ($host)" unless $host =~ /^\+(6_)?[a-zA-Z][-\w]*$/;
|
|
||||||
require_capability( 'IPSET_MATCH', 'Ipset names in host lists', '');
|
|
||||||
} else {
|
|
||||||
$host = validate_host $host, 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
push @$new, $host;
|
push @$new, $host;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user