mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-23 08:03:11 +01:00
Allow both <...> and [...] for IPv6 Addresses
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
a2efc8e827
commit
e6c0c8f6b7
@ -213,7 +213,7 @@ sub merge_macro_source_dest( $$ ) {
|
||||
if ( $invocation ) {
|
||||
if ( $body ) {
|
||||
return $body if $invocation eq '-';
|
||||
return "$body:$invocation" if $invocation =~ /.*?\.*?\.|^\+|^!+|^~|^!~|~</;
|
||||
return "$body:$invocation" if $invocation =~ /.*?\.*?\.|^\+|^!+|^~|^!~|~<|~\[/;
|
||||
return "$invocation:$body";
|
||||
}
|
||||
|
||||
|
@ -2453,11 +2453,11 @@ sub expand_rule( $$$$$$$$$$;$ )
|
||||
} else {
|
||||
$iiface = $source;
|
||||
}
|
||||
} elsif ( $source =~ /^(.+?):<(.+)>\s*$/ ) {
|
||||
} elsif ( $source =~ /^(.+?):<(.+)>\s*$/ || $source =~ /^(.+?):\[(.+)\]\s*$/ ) {
|
||||
$iiface = $1;
|
||||
$inets = $2;
|
||||
} elsif ( $source =~ /:/ ) {
|
||||
if ( $source =~ /^<(.+)>$/ ) {
|
||||
if ( $source =~ /^<(.+)>$/ || $source =~ /^<\[.+\]>$/ ) {
|
||||
$inets = $1;
|
||||
} else {
|
||||
$inets = $source;
|
||||
@ -2543,11 +2543,11 @@ sub expand_rule( $$$$$$$$$$;$ )
|
||||
} else {
|
||||
$diface = $dest;
|
||||
}
|
||||
} elsif ( $dest =~ /^(.+?):<(.+)>\s*$/ ) {
|
||||
} elsif ( $dest =~ /^(.+?):<(.+)>\s*$/ || $dest =~ /^(.+?):\[(.+)\]\s*$/) {
|
||||
$diface = $1;
|
||||
$dnets = $2;
|
||||
} elsif ( $dest =~ /:/ ) {
|
||||
if ( $dest =~ /^<(.+)>$/ ) {
|
||||
if ( $dest =~ /^<(.+)>$/ || $dest =~ /^\[(.+)\]$/ ) {
|
||||
$dnets = $1;
|
||||
} else {
|
||||
$dnets = $dest;
|
||||
|
@ -589,7 +589,7 @@ sub add_an_rtrule( ) {
|
||||
} else {
|
||||
$source = "iif $source";
|
||||
}
|
||||
} elsif ( $source =~ /^(.+?):<(.+)>\s*$/ ) {
|
||||
} elsif ( $source =~ /^(.+?):<(.+)>\s*$/ || $source =~ /^(.+?):\[(.+)\]\s*$/ ) {
|
||||
my ($interface, $source ) = ($1, $2);
|
||||
validate_net ($source, 0);
|
||||
$interface = physical_name $interface;
|
||||
|
@ -125,7 +125,7 @@ sub process_tos() {
|
||||
if ( $family == F_IPV4 ) {
|
||||
( $srczone , $source , $remainder ) = split( /:/, $src, 3 );
|
||||
fatal_error 'Invalid SOURCE' if defined $remainder;
|
||||
} elsif ( $src =~ /^(.+?):<(.*)>\s*$/ ) {
|
||||
} elsif ( $src =~ /^(.+?):<(.*)>\s*$/ || $src =~ /^(.+?):\[(.*)\]\s*$/ ) {
|
||||
$srczone = $1;
|
||||
$source = $2;
|
||||
} else {
|
||||
|
@ -1186,15 +1186,13 @@ sub process_host( ) {
|
||||
} else {
|
||||
fatal_error "Invalid HOST(S) column contents: $hosts";
|
||||
}
|
||||
} elsif ( $hosts =~ /^([\w.@%-]+\+?):<(.*)>\s*$/ || $hosts =~ /^([\w.@%-]+\+?):\[(.*)\]\s*$/ ) {
|
||||
$interface = $1;
|
||||
$hosts = $2;
|
||||
$zoneref->{options}{complex} = 1 if $hosts =~ /^\+/;
|
||||
fatal_error "Unknown interface ($interface)" unless $interfaces{$interface}{root};
|
||||
} else {
|
||||
if ( $hosts =~ /^([\w.@%-]+\+?):<(.*)>\s*$/ ) {
|
||||
$interface = $1;
|
||||
$hosts = $2;
|
||||
$zoneref->{options}{complex} = 1 if $hosts =~ /^\+/;
|
||||
fatal_error "Unknown interface ($interface)" unless $interfaces{$interface}{root};
|
||||
} else {
|
||||
fatal_error "Invalid HOST(S) column contents: $hosts";
|
||||
}
|
||||
fatal_error "Invalid HOST(S) column contents: $hosts";
|
||||
}
|
||||
|
||||
if ( $type == BPORT ) {
|
||||
|
Loading…
Reference in New Issue
Block a user