mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-18 20:30:43 +01:00
More hosts file corrections.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
0efc0451c1
commit
e2b029b0ba
@ -228,6 +228,8 @@ sub validate_4range( $$ ) {
|
||||
my $last = decodeaddr $high;
|
||||
|
||||
fatal_error "Invalid IP Range ($low-$high)" unless $first <= $last;
|
||||
|
||||
"$low-$high";
|
||||
}
|
||||
|
||||
sub validate_4host( $$ ) {
|
||||
@ -690,11 +692,13 @@ sub validate_6range( $$ ) {
|
||||
while ( @low ) {
|
||||
my ( $l, $h) = ( shift @low, shift @high );
|
||||
next if hex "0x$l" == hex "0x$h";
|
||||
return 1 if hex "0x$l" < hex "0x$h";
|
||||
return "$low-$high" if hex "0x$l" < hex "0x$h";
|
||||
last;
|
||||
}
|
||||
|
||||
fatal_error "Invalid IPv6 Range ($low-$high)";
|
||||
|
||||
|
||||
}
|
||||
|
||||
sub validate_6host( $$ ) {
|
||||
|
@ -763,12 +763,6 @@ sub add_group_to_zone($$$$$)
|
||||
$new = \@exclusions;
|
||||
}
|
||||
|
||||
if ( $host =~ /-/ ) {
|
||||
&validate_range( split('-', $host, 2 ) )
|
||||
} else {
|
||||
$host = validate_net( $host, 1 ) unless $host =~ /^\+/;
|
||||
}
|
||||
|
||||
unless ( $switched ) {
|
||||
if ( $type == $zonetype ) {
|
||||
fatal_error "Duplicate Host Group ($interface:$host) in zone $zone" if $interfaces{$interface}{zone} eq $zone;
|
||||
@ -791,7 +785,7 @@ sub add_group_to_zone($$$$$)
|
||||
fatal_error "Invalid ipset name ($host)" unless $host =~ /^\+(6_)?[a-zA-Z][-\w]*$/;
|
||||
require_capability( 'IPSET_MATCH', 'Ipset names in host lists', '');
|
||||
} else {
|
||||
validate_host $host, 0;
|
||||
$host = validate_host $host, 0;
|
||||
}
|
||||
|
||||
push @$new, $host;
|
||||
|
Loading…
Reference in New Issue
Block a user