aboutsummaryrefslogtreecommitdiffstats
path: root/config/squid/squid.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-04-18 19:03:25 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-04-18 19:03:25 -0400
commit8f73256f12a1665490bcb44aa33075635f69e865 (patch)
tree7678972fbb760e2a1b24d5fdf8bb92c1d6b55868 /config/squid/squid.inc
parentbc302e338d1b9bea79680ce1ed8c09bb3f1c4ebc (diff)
downloadpfsense-packages-8f73256f12a1665490bcb44aa33075635f69e865.tar.gz
pfsense-packages-8f73256f12a1665490bcb44aa33075635f69e865.tar.bz2
pfsense-packages-8f73256f12a1665490bcb44aa33075635f69e865.zip
Query the aliases and deterimine if we should use PPTP or pptp, PPPoe pppoe, etc
Diffstat (limited to 'config/squid/squid.inc')
-rw-r--r--config/squid/squid.inc18
1 files changed, 14 insertions, 4 deletions
diff --git a/config/squid/squid.inc b/config/squid/squid.inc
index fb437d5b..c0dc5a06 100644
--- a/config/squid/squid.inc
+++ b/config/squid/squid.inc
@@ -1218,6 +1218,16 @@ function squid_generate_rules($type) {
$ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces);
$port = ($squid_conf['proxy_port'] ? $squid_conf['proxy_port'] : 3128);
+ $fw_aliases = filter_generate_aliases();
+ if(strstr($fw_aliases, "pptp ="))
+ $PPTP_ALIAS = "\$pptp";
+ else
+ $PPTP_ALIAS = "\$PPTP";
+ if(strstr($fw_aliases, "PPPoE ="))
+ $PPPOE_ALIAS = "\$PPPoE";
+ else
+ $PPPOE_ALIAS = "\$pppoe";
+
switch($type) {
case 'nat':
$rules .= "\n# Setup Squid proxy redirect\n";
@@ -1245,11 +1255,11 @@ function squid_generate_rules($type) {
}
/* Handle PPPOE case */
if($config['pppoe']['mode'] == "server" && $config['pppoe']['localip']) {
- $rules .= "rdr on \$pppoe proto tcp from any to !(\$pppoe) port 80 -> 127.0.0.1 port 80\n";
+ $rules .= "rdr on $PPPOE_ALIAS proto tcp from any to !127.0.0.1 port 80 -> 127.0.0.1 port 80\n";
}
/* Handle PPTP case */
if($config['pptpd']['mode'] == "server" && $config['pptpd']['localip']) {
- $rules .= "rdr on \$pptp proto tcp from any to !(\$pptp) port 80 -> 127.0.0.1 port 80\n";
+ $rules .= "rdr on $PPTP_ALIAS proto tcp from any to !127.0.0.1 port 80 -> 127.0.0.1 port 80\n";
}
$rules .= "\n";
break;
@@ -1261,10 +1271,10 @@ function squid_generate_rules($type) {
$rules .= "\n";
};
if($config['pppoe']['mode'] == "server" && $config['pppoe']['localip']) {
- $rules .= "pass in quick on \$pppoe proto tcp from any to !(\$pppoe) port $port flags S/SA keep state\n";
+ $rules .= "pass in quick on $PPPOE_ALIAS proto tcp from any to !127.0.0.1 port $port flags S/SA keep state\n";
}
if($config['pptpd']['mode'] == "server" && $config['pptpd']['localip']) {
- $rules .= "pass in quick on \$pptp proto tcp from any to !(\$pptp) port $port flags S/SA keep state\n";
+ $rules .= "pass in quick on $PPTP_ALIAS proto tcp from any to !127.0.0.1 port $port flags S/SA keep state\n";
}
break;
default: