diff options
author | Chris Buechler <cmb@cmb-macbook-pro.homeunix.net> | 2009-11-07 20:29:50 -0500 |
---|---|---|
committer | Chris Buechler <cmb@cmb-macbook-pro.homeunix.net> | 2009-11-07 20:29:50 -0500 |
commit | e979cfc6ba6370556b3602b7ac43bf27e82bb1df (patch) | |
tree | 55c23a8c95714a0f400f569b87347fb25cfc00f1 | |
parent | 4e3cdd2e9f86f8ce57ad45bd7b6f72cbda70509b (diff) | |
download | pfsense-e979cfc6ba6370556b3602b7ac43bf27e82bb1df.zip pfsense-e979cfc6ba6370556b3602b7ac43bf27e82bb1df.tar.gz |
Don't add port on no nat rules. Fixes #120
-rw-r--r-- | etc/inc/filter.inc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 43ecafc..8cc9635 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -543,15 +543,6 @@ function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = " if ($dstport != "") $dst .= " port {$dstport}"; - /* Allow for negating NAT entries */ - if ($nonat) { - $nat = "no nat"; - $target = ""; - } else { - $nat = "nat"; - $target = "-> {$tgt}"; - } - /* outgoing static-port option, hamachi, Grandstream, VOIP, etc */ if($staticnatport) $staticnatport_txt = " static-port"; @@ -561,6 +552,16 @@ function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = " else $staticnatport_txt = ""; + /* Allow for negating NAT entries */ + if ($nonat) { + $nat = "no nat"; + $target = ""; + $staticnatport_txt = ""; + } else { + $nat = "nat"; + $target = "-> {$tgt}"; + } + $if_friendly = convert_real_interface_to_friendly_descr($if); /* Put all the pieces together */ |