mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Allow from IP to be missing in --to-destination option
This commit is contained in:
@@ -132,6 +132,12 @@ if (($table->{'name'} eq 'nat' && $rule->{'chain'} ne 'POSTROUTING') &&
|
||||
$dpfrom = $5;
|
||||
$dpto = $7;
|
||||
}
|
||||
elsif ($rule->{'to-destination'}->[1] =~ /^(:(\d+)(\-(\d+))?)?$/) {
|
||||
$dipfrom = "";
|
||||
$dipto = "";
|
||||
$dpfrom = $2;
|
||||
$dpto = $4;
|
||||
}
|
||||
}
|
||||
print &ui_table_row($text{'edit_dnat'},
|
||||
&ui_radio("dnatdef", $dipfrom eq "" ? 1 : 0,
|
||||
|
||||
@@ -89,7 +89,7 @@ else {
|
||||
}
|
||||
if ($table->{'name'} eq 'nat' && $rule->{'chain'} ne 'POSTROUTING') {
|
||||
if ($rule->{'j'}->[1] eq 'DNAT' && !$in{'dnatdef'}) {
|
||||
&check_ipaddress($in{'dipfrom'}) ||
|
||||
!$in{'dipfrom'} || &check_ipaddress($in{'dipfrom'}) ||
|
||||
&error($text{'save_edipfrom'});
|
||||
!$in{'dipto'} || &check_ipaddress($in{'dipto'}) ||
|
||||
&error($text{'save_edipto'});
|
||||
|
||||
Reference in New Issue
Block a user