From a74e76c636ae76e15fcde9ea612df31edc3ee930 Mon Sep 17 00:00:00 2001 From: jdegraeve Date: Wed, 29 Mar 2006 22:14:34 +0000 Subject: [PATCH] Change captiveportal_get_next_ipfw_ruleno function to adapt dynamically to the firewall rules already in use, allowing for smaller range tables (should be faster on slower hardware). Now supports calling by other functions who need a free firewall ruleno by specifying the range_start git-svn-id: https://svn.m0n0.ch/wall/trunk@118 e36fee2c-cc09-0410-a7cc-ebac5c6737de --- phpconf/inc/captiveportal.inc | 4 ++-- webgui/license.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpconf/inc/captiveportal.inc b/phpconf/inc/captiveportal.inc index a7d2ae1..70acace 100644 --- a/phpconf/inc/captiveportal.inc +++ b/phpconf/inc/captiveportal.inc @@ -892,15 +892,15 @@ function captiveportal_write_elements() { * */ -function captiveportal_get_next_ipfw_ruleno() { +function captiveportal_get_next_ipfw_ruleno($rulenos_start = 10000) { exec("/sbin/ipfw show", $fwrules); foreach ($fwrules as $fwrule) { preg_match("/^(\d+)\s+/", $fwrule, $matches); $rulenos_used[] = $matches[1]; } - $rulenos_pool = range(10000, 19899); $rulenos_used = array_unique($rulenos_used); + $rulenos_pool = range($rulenos_start, ($rulenos_start + count($rulenos_used))); $rulenos_free = array_diff($rulenos_pool, $rulenos_used); $ruleno = array_shift($rulenos_free); diff --git a/webgui/license.php b/webgui/license.php index b7626b5..bd06ca2 100755 --- a/webgui/license.php +++ b/webgui/license.php @@ -166,8 +166,8 @@ require("guiconfig.inc");     Webgui users/groups

Jonathan De Graeve (Jonathan.De.Graeve@imelda.be)
-     Complete captive portal RADIUS overhaul, cleanup

-     captive portal: file manager, volume stats, FW rulepool (virtual port pool)

+     Complete captive portal RADIUS overhaul, cleanup
+     captive portal: file manager, volume stats, FW rulepool (virtual port pool)

m0n0wall is based upon/includes various free software packages, listed below.
-- 2.25.1