redirect port range must not use :*, calculate end port and create the correct rule

This commit is contained in:
Renato Botelho 2010-04-19 11:07:31 -03:00
parent 50dc3f4113
commit 6d346c1754

View File

@ -1126,13 +1126,17 @@ function filter_nat_rules_generate() {
/* if item is an alias, expand */
$localport = alias_expand($rule['local-port']);
if(!$localport || $rule['destination']['port'] == $rule['local-port'])
if(!$localport || $rule['destination']['port'] == $rule['local-port']) {
$localport = "";
else
$localport = " port {$localport}";
} else {
if(($dstport[1]) && ($dstport[0] != $dstport[1])) {
$localendport = $localport + ($dstport[1] - $dstport[0]);
if(($dstport[1]) && ($dstport[0] != $dstport[1]))
$localport .= ":*";
$localport .= ":$localendport";
}
$localport = " port {$localport}";
}
$target = alias_expand($rule['target']);
if(!$target) {