diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2011-02-13 09:20:15 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2011-02-13 09:27:51 -0700 |
commit | ca640261f33d5489d44a8bbc37d875d9986cf34f (patch) | |
tree | 2159307325a83e0b56ebca2e06b44b3c8846018e /etc | |
parent | d164643a3560174bf1caabef4649b5b2a382b8ff (diff) | |
download | pfsense-ca640261f33d5489d44a8bbc37d875d9986cf34f.zip pfsense-ca640261f33d5489d44a8bbc37d875d9986cf34f.tar.gz |
Add alias support for source and destination ports on outbound NAT.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 092060f..da72c77 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1121,14 +1121,22 @@ function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = " if($src == "") $src = "any"; /* Match on this source port */ - if($srcport != "") - $src .= " port {$srcport}"; + if($srcport != "") { + $srcportexpand = alias_expand($srcport); + if(!$srcportexpand) + $srcportexpand = $srcport; + $src .= " port {$srcportexpand}"; + } /* sometimes this gets called with "" instead of a value */ if($dst == "") $dst = "any"; /* Match on this dest port */ - if($dstport != "") - $dst .= " port {$dstport}"; + if($dstport != "") { + $dstportexpand = alias_expand($dstport); + if(!$dstportexpand) + $dstportexpand = $dstport; + $dst .= " port {$dstportexpand}"; + } /* outgoing static-port option, hamachi, Grandstream, VOIP, etc */ $staticnatport_txt = ""; if($staticnatport) |