aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-07-30 00:11:52 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-07-30 00:11:52 +0000
commit58a559aee126e9b4a00c29f0d64b5f89ddd0144c (patch)
treee6f1fe3c6bf04f826b5a62634371f09758da540b
parent6583b8b03f0b89c0974c957f5e9ba3320396202b (diff)
downloadpfsense-packages-58a559aee126e9b4a00c29f0d64b5f89ddd0144c.tar.gz
pfsense-packages-58a559aee126e9b4a00c29f0d64b5f89ddd0144c.tar.bz2
pfsense-packages-58a559aee126e9b4a00c29f0d64b5f89ddd0144c.zip
Default to port 3128 if user has not filled in a custom port.
-rw-r--r--packages/squid.inc16
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/squid.inc b/packages/squid.inc
index d84001ba..c7ce446a 100644
--- a/packages/squid.inc
+++ b/packages/squid.inc
@@ -754,20 +754,26 @@ function squid_generate_rules($type) {
global $config;
$squid_conf = $config['installedpackages']['squid']['config'][0];
- if (!is_service_running('squid') || ($squid_conf['transparent_proxy'] != 'on')) return;
+ if (!is_service_running('squid') || ($squid_conf['transparent_proxy'] != 'on')) {
+ log_error("SQUID is installed but not started. Not installing redirect rules.");
+ return;
+ }
- $port = $squid_conf['proxy_port'];
+ if($squid_conf['proxy_port'])
+ $port = $squid_conf['proxy_port'];
+ else
+ $port = "3128";
$ifaces = explode(',', $squid_conf['active_interface']);
$ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces);
switch($type) {
case 'nat':
foreach ($ifaces as $iface)
- $rules .= "rdr on $iface inet proto tcp to !($iface) port 80 -> ($iface) port $port\n";
+ $rules .= "rdr on $iface proto tcp from any to !($iface) port 80 -> ($iface) port $port\n";
break;
case 'filter':
foreach ($ifaces as $iface)
- $rules .= "pass quick on $iface inet proto tcp to !($iface) port 80 flags S/SA keep state\n";
+ $rules .= "pass quick on $iface proto tcp from any to !($iface) port 80 flags S/SA keep state\n";
break;
default:
break;
@@ -775,4 +781,4 @@ function squid_generate_rules($type) {
return $rules;
}
-?>
+?> \ No newline at end of file