From e979cfc6ba6370556b3602b7ac43bf27e82bb1df Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sat, 7 Nov 2009 20:29:50 -0500 Subject: Don't add port on no nat rules. Fixes #120 --- etc/inc/filter.inc | 19 ++++++++++--------- 1 file 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 */ -- cgit v1.1