Detect incorrect port-range separator in SNAT(...)

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-11-01 11:28:19 -07:00
parent a89d8b3af4
commit 032a16eb43
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
2 changed files with 2 additions and 2 deletions

View File

@ -280,7 +280,7 @@ sub process_one_masq1( $$$$$$$$$$$$ )
} elsif ( $family == F_IPV4 ) {
if ( $addr =~ /^.*\..*\..*\./ ) {
$target = 'SNAT ';
my ($ipaddr, $rest) = split ':', $addr;
my ($ipaddr, $rest) = split ':', $addr, 2;
if ( $ipaddr =~ /^(.+)-(.+)$/ ) {
validate_range( $1, $2 );
} else {

View File

@ -5553,7 +5553,7 @@ sub process_snat1( $$$$$$$$$$$$ ) {
}
} elsif ( $family == F_IPV4 ) {
if ( $addr =~ /^.*\..*\..*\./ ) {
my ($ipaddr, $rest) = split ':', $addr;
my ($ipaddr, $rest) = split ':', $addr, 2;
if ( $ipaddr =~ /^(.+)-(.+)$/ ) {
validate_range( $1, $2 );
} else {