mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-24 07:08:53 +01:00
Correct handling of new ipv6 net syntax in the hosts file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
ffcf262de4
commit
91e2c31a58
@ -1766,7 +1766,7 @@ sub process_host( ) {
|
|||||||
}
|
}
|
||||||
} elsif ( $hosts =~ /^([\w.@%-]+\+?):<(.*)>$/ ||
|
} elsif ( $hosts =~ /^([\w.@%-]+\+?):<(.*)>$/ ||
|
||||||
$hosts =~ /^([\w.@%-]+\+?):\[(.*)\]$/ ||
|
$hosts =~ /^([\w.@%-]+\+?):\[(.*)\]$/ ||
|
||||||
$hosts =~ /^([\w.@%-]+\+?):(!?\+.*)$/ ||
|
$hosts =~ /^([\w.@%-]+\+?):(\[.+\](?:\/\d+)?)$/ ||
|
||||||
$hosts =~ /^([\w.@%-]+\+?):(dynamic)$/ ) {
|
$hosts =~ /^([\w.@%-]+\+?):(dynamic)$/ ) {
|
||||||
$interface = $1;
|
$interface = $1;
|
||||||
$hosts = $2;
|
$hosts = $2;
|
||||||
@ -1776,10 +1776,20 @@ sub process_host( ) {
|
|||||||
fatal_error "Invalid HOST(S) column contents: $hosts"
|
fatal_error "Invalid HOST(S) column contents: $hosts"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $hosts =~ /^!?\+/ ) {
|
unless ( $hosts eq 'dynamic' ) {
|
||||||
|
my @hosts = split_list1( $hosts , 'host' );
|
||||||
|
|
||||||
|
for ( @hosts ) {
|
||||||
|
if ( $_ =~ /^!?\+/ ) {
|
||||||
$zoneref->{complex} = 1;
|
$zoneref->{complex} = 1;
|
||||||
fatal_error "ipset name qualification is disallowed in this file" if $hosts =~ /[\[\]]/;
|
fatal_error "ipset name qualification is disallowed in this file" if /[\[\]]/;
|
||||||
fatal_error "Invalid ipset name ($hosts)" unless $hosts =~ /^!?\+[a-zA-Z][-\w]*$/;
|
fatal_error "Invalid ipset name ($hosts)" unless /^!?\+[a-zA-Z][-\w]*$/;
|
||||||
|
} else {
|
||||||
|
$_ = validate_net( $_, 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$hosts = join( ',', @hosts );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $type & BPORT ) {
|
if ( $type & BPORT ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user