diff options
Diffstat (limited to 'packages/squid.inc')
-rw-r--r-- | packages/squid.inc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/squid.inc b/packages/squid.inc index af0d7bda..670c8985 100644 --- a/packages/squid.inc +++ b/packages/squid.inc @@ -755,14 +755,17 @@ function squid_generate_rules($type) { $ifaces = explode(',', $squid_conf['active_interface']); $ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces); - if ($type == 'nat') { + switch($type) { + case 'nat': foreach ($ifaces as $iface) $rules .= "rdr on $iface inet proto tcp to !($iface) port 80 -> ($iface) port $port\n"; - } - - else { + 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"; + break; + default: + break; } return $rules; |