summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-08-02 18:43:39 -0600
committerErik Fonnesbeck <efonnes@gmail.com>2010-08-02 19:06:01 -0600
commitef7705b61dc4e744ac571db3986eb44c22d98128 (patch)
tree85b7fcccda7ed3f649ff6c68ac7d406a0abbb429 /etc
parent0c9f92bf36fec31af2add57bc5bb05f328bd1652 (diff)
downloadpfsense-ef7705b61dc4e744ac571db3986eb44c22d98128.zip
pfsense-ef7705b61dc4e744ac571db3986eb44c22d98128.tar.gz
Convert outbound NAT rule code to using $FilterIflist for getting alias names and fix a case where the wrong name could get into the rule when there is no IP address.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index c480381..a417d07 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -996,7 +996,7 @@ function filter_generate_reflection($rule, $nordr, $rdr_ifs, $srcaddr, $dstaddr_
/* Generate a 'nat on' or 'no nat on' rule for given interface */
function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "any", $dstport = "", $natip = "", $natport = "", $nonat = false, $staticnatport = false, $proto = "") {
- global $config;
+ global $config, $FilterIflist;
/* XXX: billm - any idea if this code is needed? */
if($src == "/32" || $src{0} == "/")
return "# src incorrectly specified\n";
@@ -1007,7 +1007,7 @@ function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "
if(is_ipaddr($natip))
$tgt = "{$natip}/32";
else
- $tgt = "($if)";
+ $tgt = "(" . $FilterIflist[$if]['if'] . ")";
}
/* Add the protocol, if defined */
if (!empty($proto) && $proto != "any") {
@@ -1049,7 +1049,7 @@ function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "
$nat = "nat";
$target = "-> {$tgt}";
}
- $if_friendly = convert_friendly_interface_to_friendly_descr($if);
+ $if_friendly = $FilterIflist[$if]['descr'];
/* Put all the pieces together */
if($if_friendly)
$natrule = "{$nat} on \${$if_friendly} {$protocol} from {$src} to {$dst} {$target}{$staticnatport_txt}\n";
OpenPOWER on IntegriCloud