mirror of
https://github.com/webmin/webmin.git
synced 2026-06-20 11:20:30 +01:00
--to-source can be followed by just a :port
This commit is contained in:
@@ -155,7 +155,7 @@ if (($table->{'name'} eq 'nat' && $rule->{'chain'} ne 'PREROUTING' &&
|
||||
&can_jump("SNAT")) {
|
||||
if ($rule->{'j'}->[1] eq 'SNAT') {
|
||||
if ($rule->{'to-source'}->[1] =~
|
||||
/^([0-9\.]+)(\-([0-9\.]+))?(:(\d+)(\-(\d+))?)?$/) {
|
||||
/^([0-9\.]+)?(\-([0-9\.]+))?(:(\d+)(\-(\d+))?)?$/) {
|
||||
$sipfrom = $1;
|
||||
$sipto = $3;
|
||||
$spfrom = $5;
|
||||
|
||||
@@ -116,7 +116,8 @@ else {
|
||||
if ($table->{'name'} eq 'nat' && $rule->{'chain'} ne 'PREROUTING' &&
|
||||
$rule->{'chain'} ne 'OUTPUT') {
|
||||
if ($rule->{'j'}->[1] eq 'SNAT' && !$in{'snatdef'}) {
|
||||
&check_ipaddress($in{'sipfrom'}) ||
|
||||
(!$in{'sipfrom'} && !$in{'sipto'}) ||
|
||||
&check_ipaddress($in{'sipfrom'}) ||
|
||||
&error($text{'save_esipfrom'});
|
||||
!$in{'sipto'} || &check_ipaddress($in{'sipto'}) ||
|
||||
&error($text{'save_esipto'});
|
||||
|
||||
Reference in New Issue
Block a user