diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 883b30a6e8..e0f3244457 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -790,22 +790,26 @@ function filter_nat_rules_generate() { if($target <> "") { log_error("target <> ''"); if($extport[0] == "21" and !isset($config['interfaces'][strtolower($rule['interface'])]['disableftpproxy'])) { - log_error("Testing for /bin/ps awux | grep \"{$target} -b {$external_address}\" | grep -v grep"); - $helpers = exec("/bin/ps awux | grep \"{$target} -b {$external_address}\" | grep -v grep"); + if($extaddr == "any") { + $external_address_text = ""; + } else { + $external_address_text = " -b {$extaddr}"; + } + $helpers = exec("/bin/ps awux | grep \"{$target}{$external_address_text}\" | grep -v grep"); if(!$helpers) { log_error("no helper detected"); $external_address = $rule['external-address']; if($external_address == "") $external_address = find_interface_ip(get_real_wan_interface()); - /* install a pftpx helper, do not set a rule. also use the delay filter configure run - * routines because if this is the first bootup the filter is not completely configured - * and thus pf is not fully running. otherwise we end up with: pftpx: pf is disabled - */ - if($rule['force_ftp_source_ip']) - $force_ftp_source_ip = $rule['force_ftp_source_ip']; - else - $force_ftp_source_ip = ""; - $after_filter_configure_run[] = "/usr/local/sbin/pftpx -f {$target} -b {$external_address} -c 21 -g 21 {$force_ftp_source_ip} 2>>/tmp/pftpx_errors"; + /* install a pftpx helper, do not set a rule. also use the delay filter configure run + * routines because if this is the first bootup the filter is not completely configured + * and thus pf is not fully running. otherwise we end up with: pftpx: pf is disabled + */ + if($rule['force_ftp_source_ip']) + $force_ftp_source_ip = $rule['force_ftp_source_ip']; + else + $force_ftp_source_ip = ""; + $after_filter_configure_run[] = "/usr/local/sbin/pftpx -f {$target} -b {$external_address} -c 21 -g 21 {$force_ftp_source_ip} 2>>/tmp/pftpx_errors"; } $dontinstallrdr = true; }