summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-12-07 20:13:07 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-12-07 20:13:07 +0000
commit1372ae55f99d70a4baefc510aaf8e9e9de45c2d3 (patch)
treeeb19154d0aa68181a3e0e9c4908328dda05d7b63
parent793df875fcce035b653591b477b5e3220f20466e (diff)
downloadpfsense-1372ae55f99d70a4baefc510aaf8e9e9de45c2d3.zip
pfsense-1372ae55f99d70a4baefc510aaf8e9e9de45c2d3.tar.gz
Compare rules.debug to previously loaded rules. If no rule changes
have occured, do not try to reload the rules and sync changes to backup members which can result in the rules being reloaded constantly when load balancing is in use, etc.
-rw-r--r--etc/inc/filter.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index c3b711f..5f18374 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -53,6 +53,8 @@ function filter_pflog_start() {
echo "filter_pflog_start() being called $mt\n";
}
+ if($g['booting'])
+ echo "Starting pflog0...";
mute_kernel_msgs();
$pid = `ps awwwux | grep -v "grep" | grep "tcpdump -s 256 -v -l -n -e -ttt -i pflog0" | awk '{ print $2 }'`;
@@ -61,6 +63,9 @@ function filter_pflog_start() {
unmute_kernel_msgs();
+ if($g['booting'])
+ echo "done.\n";
+
}
/* reload filter async */
@@ -162,6 +167,9 @@ function filter_configure_sync() {
return;
}
+ // Copy rules.debug to rules.debug.old
+ exec("cp {$g['tmp_path']}/rules.debug {$g['tmp_path']}/rules.debug.old");
+
$fd = fopen("{$g['tmp_path']}/rules.debug", "w");
$rules = $aliases . " \n";
@@ -216,6 +224,13 @@ function filter_configure_sync() {
fwrite($fd, $rules);
fclose($fd);
+ $rules = file_get_contents("{$g['tmp_path']}/rules.debug");
+ $oldrules = file_get_contents("{$g['tmp_path']}/rules.debug.old");
+
+ /* Check to see if rules changed, if not do not continue */
+ if($rules == $oldrules)
+ return;
+
if(isset($config['system']['developerspew'])) {
$mt = microtime();
echo "pfctl being called at $mt\n";
OpenPOWER on IntegriCloud