summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc14
1 files changed, 9 insertions, 5 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index fc306cd..81a2aa4 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -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) {
OpenPOWER on IntegriCloud