summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2015-01-15 18:53:54 +0100
committerErmal LUÇI <eri@pfsense.org>2015-01-15 18:53:54 +0100
commit98bf4991dc31f97fc7315a6b8aba433de9d39cea (patch)
treed57d8c9387bbb319da10515ebf2801f084500b22 /etc
parent07d0d1b23ff415c7df3330523d19c552dd40c7b8 (diff)
downloadpfsense-98bf4991dc31f97fc7315a6b8aba433de9d39cea.zip
pfsense-98bf4991dc31f97fc7315a6b8aba433de9d39cea.tar.gz
Fixes #4150. Move to tables to accomodate unlimited number of interfaces.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc26
1 files changed, 13 insertions, 13 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 4fc1f65..73b805e 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -513,10 +513,12 @@ function captiveportal_init_rules($reinit = false) {
if ($reinit == false)
$captiveportallck = lock("captiveportal{$cpzone}");
- $cprules = "add 65291 allow pfsync from any to any\n";
- $cprules .= "add 65292 allow carp from any to any\n";
+ $cprules = <<<EOD
+
+flush
+add 65291 allow pfsync from any to any
+add 65292 allow carp from any to any
- $cprules .= <<<EOD
# layer 2: pass ARP
add 65301 pass layer2 mac-type arp,rarp
# pfsense requires for WPA
@@ -530,17 +532,16 @@ add 65307 deny layer2 not mac-type ip,ipv6
EOD;
$rulenum = 65310;
- $ipcount = 0;
+ /* These tables contain host ips */
+ $cprules .= "add {$rulenum} pass ip from any to table(100) in\n";
+ $rulenum++;
+ $cprules .= "add {$rulenum} pass ip from table(100) to any out\n";
+ $rulenum++;
$ips = "";
foreach ($cpips as $cpip) {
- if($ipcount == 0) {
- $ips = "{$cpip} ";
- } else {
- $ips .= "or {$cpip} ";
- }
- $ipcount++;
+ $cprules .= "table 100 add {$cpip}\n";
}
- $ips = "{ 255.255.255.255 or {$ips} }";
+ $cprules .= "table 100 add 255.255.255.255\n";
$cprules .= "add {$rulenum} pass ip from any to {$ips} in\n";
$rulenum++;
$cprules .= "add {$rulenum} pass ip from {$ips} to any out\n";
@@ -602,11 +603,10 @@ EOD;
$cprules .= captiveportal_allowedhostname_configure();
/* load rules */
- $cprules = "flush\n{$cprules}";
file_put_contents("{$g['tmp_path']}/ipfw_{$cpzone}.cp.rules", $cprules);
mwexec("/sbin/ipfw -x {$cpzoneid} -q {$g['tmp_path']}/ipfw_{$cpzone}.cp.rules", true);
//@unlink("{$g['tmp_path']}/ipfw_{$cpzone}.cp.rules");
- unset($cprules, $tmprules);
+ unset($cprules);
if ($reinit == false)
unlock($captiveportallck);
OpenPOWER on IntegriCloud