summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-21 22:33:31 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-21 22:33:31 +0000
commit1c5c95a25326d04fb9a9aa306ded66d56aa219d2 (patch)
tree8aa4e35734f00a826681998c1a5d6d0cb4961dec /etc
parentb393ce28c5cdc9cc17419363183293bfe63d04fa (diff)
downloadpfsense-1c5c95a25326d04fb9a9aa306ded66d56aa219d2.zip
pfsense-1c5c95a25326d04fb9a9aa306ded66d56aa219d2.tar.gz
MFC 7042
Do not clear out the ENTIRE nat ruleset by moving the pftpx check above the nat rule construction portion.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc34
1 files changed, 17 insertions, 17 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 4947bd5..5dcf385 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -601,6 +601,23 @@ function filter_nat_rules_generate() {
if(alias_expand($extaddr))
$extaddr = alias_expand($extaddr);
+ /*
+ * If FTP Proxy Helper is enbabled and the
+ * operator has requested a port forward to
+ * a ftp server then launch a helper
+ */
+ if($target <> "") {
+ if($extport[0] == "21" and !$config['system']['disableftpproxy']) {
+ $helpers = exec("ps aux | grep pftpx | grep {$target}");
+ echo "{$helpers}\n";
+ if(!$helpers) {
+ /* install a pftpx helper, do not set a rule */
+ mwexec_bg("/usr/local/sbin/pftpx -b {$extaddr} -c 21 -f {$target} -g 21");
+ return;
+ }
+ }
+ }
+
if ((!$extport[1]) || ($extport[0] == $extport[1])) {
if($rule['protocol'] == "tcp/udp")
$natrules .=
@@ -618,23 +635,6 @@ function filter_nat_rules_generate() {
"rdr on $natif proto {$rule['protocol']} from any to {$extaddr} port {$extport[0]}:{$extport[1]} -> {$target} port {$extport[0]}:*";
}
- /*
- * If FTP Proxy Helper is enbabled and the
- * operator has requested a port forward to
- * a ftp server then launch a helper
- */
- if($target <> "") {
- if($extport[0] == "21" and !$config['system']['disableftpproxy']) {
- $helpers = exec("ps aux | grep pftpx | grep {$target}");
- echo "{$helpers}\n";
- if(!$helpers) {
- /* install a pftpx helper, do not set a rule */
- mwexec_bg("/usr/local/sbin/pftpx -b {$extaddr} -c 21 -f {$target} -g 21");
- $natrules = "";
- }
- }
- }
-
$natrules .= "\n";
}
}
OpenPOWER on IntegriCloud