mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-24 23:28:59 +01:00
Fixes for IPv6 DNAT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
45d53bdb1d
commit
78babf0941
@ -690,10 +690,16 @@ sub handle_nat_rule( $$$$$$$$$$$$ ) {
|
|||||||
validate_range( $1, $2 );
|
validate_range( $1, $2 );
|
||||||
} else {
|
} else {
|
||||||
my ( $addr1, $addr2 ) = ( $1, $2 );
|
my ( $addr1, $addr2 ) = ( $1, $2 );
|
||||||
$addr1 = $1 if $addr1 =~ /^\[(.+)\]$/;
|
|
||||||
$addr2 = $1 if $addr2 =~ /^\[(.+)\]$/;
|
if ( $server =~ /^\[(.+)\]$/ ) {
|
||||||
|
$server = $1;
|
||||||
|
fatal_error "Correct address range syntax is '[<addr1>-<addr2>]'" if $server =~ /]-\[/;
|
||||||
|
assert( $server =~ /^(.+)-(.+)$/ );
|
||||||
|
( $addr1, $addr2 ) = ( $1, $2 );
|
||||||
|
}
|
||||||
|
|
||||||
validate_range( $addr1, $addr2 );
|
validate_range( $addr1, $addr2 );
|
||||||
$server = join '-', $addr1, $addr2
|
$server = join( '-', $addr1, $addr2 );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unless ( $server eq ALLIP ) {
|
unless ( $server eq ALLIP ) {
|
||||||
@ -713,7 +719,6 @@ sub handle_nat_rule( $$$$$$$$$$$$ ) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for my $serv ( split /,/, $server ) {
|
for my $serv ( split /,/, $server ) {
|
||||||
$serv =~ s/-/]-[/; #In case this is a range.
|
|
||||||
$target .= " --to-destination [${serv}]${serverport}";
|
$target .= " --to-destination [${serv}]${serverport}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user