diff --git a/Shorewall/Perl/Shorewall/Nat.pm b/Shorewall/Perl/Shorewall/Nat.pm index c009eaad8..ce1456313 100644 --- a/Shorewall/Perl/Shorewall/Nat.pm +++ b/Shorewall/Perl/Shorewall/Nat.pm @@ -207,8 +207,9 @@ sub process_one_masq( ) } else { my $ports = $addr; $ports =~ s/^://; - $ports =~ s/-/:/; - validate_portpair( $proto, $ports ); + my $portrange = $ports; + $portrange =~ s/-/:/; + validate_portpair( $proto, $portrange ); $addrlist .= "--to-ports $ports "; $exceptionrule = do_proto( $proto, '', '' ); }