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:
Tom Eastep 2012-10-08 08:54:54 -07:00
parent 880e63064b
commit 54e066ec3a

View File

@ -764,6 +764,13 @@ sub add_group_to_zone($$$$$)
$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 ) {
if ( $type == $zonetype ) {
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;
}