mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
Fix additional masq/snat issues.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
6e08717089
commit
e188bde6c4
@ -286,8 +286,14 @@ sub process_one_masq1( $$$$$$$$$$$$ )
|
|||||||
} else {
|
} else {
|
||||||
validate_address $ipaddr, 0;
|
validate_address $ipaddr, 0;
|
||||||
}
|
}
|
||||||
validate_portpair1( $proto, $rest ) if supplied $rest;
|
|
||||||
$addrlist .= "--to-source $ipaddr ";
|
if ( supplied $rest ) {
|
||||||
|
validate_portpair1( $proto, $rest );
|
||||||
|
$addrlist .= "--to-source $addr ";
|
||||||
|
} else {
|
||||||
|
$addrlist .= "--to-source $ipaddr";
|
||||||
|
}
|
||||||
|
|
||||||
$exceptionrule = do_proto( $proto, '', '' ) if $addr =~ /:/;
|
$exceptionrule = do_proto( $proto, '', '' ) if $addr =~ /:/;
|
||||||
} else {
|
} else {
|
||||||
my $ports = $addr;
|
my $ports = $addr;
|
||||||
@ -399,7 +405,11 @@ sub process_one_masq1( $$$$$$$$$$$$ )
|
|||||||
if ( $snat ) {
|
if ( $snat ) {
|
||||||
$target =~ s/ .*//;
|
$target =~ s/ .*//;
|
||||||
$target .= '+' if $pre_nat;
|
$target .= '+' if $pre_nat;
|
||||||
$target .= '(' . $addresses . ')' if $addresses ne '-' && $addresses ne 'NONAT';
|
|
||||||
|
if ( $addresses ne '-' && $addresses ne 'NONAT' ) {
|
||||||
|
$addresses =~ s/^://;
|
||||||
|
$target .= '(' . $addresses . ')';
|
||||||
|
}
|
||||||
|
|
||||||
my $line = "$target\t$networks\t$savelist\t$proto\t$ports\t$ipsec\t$mark\t$user\t$condition\t$origdest\t$probability";
|
my $line = "$target\t$networks\t$savelist\t$proto\t$ports\t$ipsec\t$mark\t$user\t$condition\t$origdest\t$probability";
|
||||||
#
|
#
|
||||||
|
@ -5559,8 +5559,14 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
} else {
|
} else {
|
||||||
validate_address $ipaddr, 0;
|
validate_address $ipaddr, 0;
|
||||||
}
|
}
|
||||||
validate_portpair1( $proto, $rest ) if supplied $rest;
|
|
||||||
$addrlist .= " --to-source $ipaddr";
|
if ( supplied $rest ) {
|
||||||
|
validate_portpair1( $proto, $rest );
|
||||||
|
$addrlist .= " --to-source $addr";
|
||||||
|
} else {
|
||||||
|
$addrlist .= " --to-source $ipaddr";
|
||||||
|
}
|
||||||
|
|
||||||
$exceptionrule = do_proto( $proto, '', '' ) if $addr =~ /:/;
|
$exceptionrule = do_proto( $proto, '', '' ) if $addr =~ /:/;
|
||||||
} else {
|
} else {
|
||||||
my $ports = $addr;
|
my $ports = $addr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user