aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Stefan Haischt <dsh@pfsense.org>2006-08-05 02:58:33 +0000
committerDaniel Stefan Haischt <dsh@pfsense.org>2006-08-05 02:58:33 +0000
commit7cf0ed21b014a556f9029e2842e002831e131284 (patch)
tree905fc512129a0f345c77228fae5dfdb4d007aa3c
parent3ae36c4cd0a6a4caa697dbe613b62491cbc58e73 (diff)
downloadpfsense-packages-7cf0ed21b014a556f9029e2842e002831e131284.tar.gz
pfsense-packages-7cf0ed21b014a556f9029e2842e002831e131284.tar.bz2
pfsense-packages-7cf0ed21b014a556f9029e2842e002831e131284.zip
- return if theres no IP or port. doesnt make sense to setup NAT rules without an IP and/or port.
-rw-r--r--packages/p3scan-pf/p3scan-pf.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/p3scan-pf/p3scan-pf.inc b/packages/p3scan-pf/p3scan-pf.inc
index ede4b7b4..03773f47 100644
--- a/packages/p3scan-pf/p3scan-pf.inc
+++ b/packages/p3scan-pf/p3scan-pf.inc
@@ -357,9 +357,14 @@ function remove_transparency() {
function setup_transparency() {
global $config;
$cfg = $config['installedpackages']['p3scanpf']['config'][0];
+ $ip = $cfg['ipaddr'];
+ $port = $cfg['port'];
+
+ if ($ip == "" || $port == "") { return; }
+
$trans_file = fopen("/tmp/p3scan_pf.rules","w");
fwrite($trans_file, "table <p3scan> persist\n");
- fwrite($trans_file, "rdr on " . $config['interfaces']['lan']['if'] . " inet proto tcp from !<p3scan> to ! " . $config['interfaces']['lan']['ipaddr'] . " port = pop3 -> {$cfg['ipaddr']} port {$cfg['port']} \n");
+ fwrite($trans_file, "rdr on " . $config['interfaces']['lan']['if'] . " inet proto tcp from !<p3scan> to ! " . $config['interfaces']['lan']['ipaddr'] . " port = pop3 -> {$ip} port {$port} \n");
fclose($trans_file);
$p3scan_pf_result = mwexec ('pfctl -a "rdr-package/p3scan" -f /tmp/p3scan_pf.rules');
if($p3scan_pf_result <> 0) {