summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2016-11-21 13:53:27 -0500
committerSteve Beaver <sbeaver@netgate.com>2016-11-21 13:54:35 -0500
commit5bf9c6f7add7f84d3aef15c56da89a10a74b59b1 (patch)
tree77d5efa4dae1be90f73d2234ea33fc65770be088
parenta7391526c83a8d4b33e81d730141a4811ae8d482 (diff)
downloadpfsense-5bf9c6f7add7f84d3aef15c56da89a10a74b59b1.zip
pfsense-5bf9c6f7add7f84d3aef15c56da89a10a74b59b1.tar.gz
Revise update_filter_relaod_status() function to append status messages rather than overwrite the file
-rw-r--r--src/etc/inc/filter.inc2
-rw-r--r--src/etc/inc/util.inc16
-rw-r--r--src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc1
-rw-r--r--src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc1
4 files changed, 11 insertions, 9 deletions
diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc
index 78b9ac9..a304707 100644
--- a/src/etc/inc/filter.inc
+++ b/src/etc/inc/filter.inc
@@ -264,7 +264,7 @@ function filter_configure_sync($delete_states_if_needed = true) {
$filterlck = lock('filter', LOCK_EX);
filter_pflog_start();
- update_filter_reload_status(gettext("Initializing"));
+ update_filter_reload_status(gettext("Initializing"), true); // second argument = overwrite existing file
/* invalidate interface cache */
get_interface_arr(true);
diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc
index 28d2a54..b095dca 100644
--- a/src/etc/inc/util.inc
+++ b/src/etc/inc/util.inc
@@ -860,10 +860,10 @@ function subnet_size_by_netmask($iptype, $bits, $exact=false) {
return 0;
}
- // 2**N returns an exact result as an INT if possible, and a float/double if not.
+ // 2**N returns an exact result as an INT if possible, and a float/double if not.
// Detect this switch, rather than comparing $result<=PHP_MAX_INT or $bits >=8*PHP_INT_SIZE as it's (probably) easier to get completely reliable
$result = 2 ** $snsize;
-
+
if ($exact && !is_int($result)) {
//exact required but can't represent result exactly as an INT
return 0;
@@ -903,7 +903,7 @@ function check_subnetsv4_overlap($subnet1, $bits1, $subnet2, $bits2) {
$largest_sn = min($bits1, $bits2);
$subnetv4_start1 = gen_subnetv4($subnet1, $largest_sn);
$subnetv4_start2 = gen_subnetv4($subnet2, $largest_sn);
-
+
if ($subnetv4_start1 == '' || $subnetv4_start2 == '') {
// One or both args is not a valid IPv4 subnet
//FIXME: needs to return "bad data" not true/false if bad. For now return false, best we can do until fixed
@@ -918,7 +918,7 @@ function check_subnetsv6_overlap($subnet1, $bits1, $subnet2, $bits2) {
$largest_sn = min($bits1, $bits2);
$subnetv6_start1 = gen_subnetv6($subnet1, $largest_sn);
$subnetv6_start2 = gen_subnetv6($subnet2, $largest_sn);
-
+
if ($subnetv6_start1 == '' || $subnetv6_start2 == '') {
// One or both args is not a valid IPv6 subnet
//FIXME: needs to return "bad data" not true/false if bad. For now return false, best we can do until fixed
@@ -1906,10 +1906,14 @@ function format_number($num, $precision = 3) {
return ("$num {$units[$i]}");
}
-function update_filter_reload_status($text) {
+function update_filter_reload_status($text, $new=false) {
global $g;
- file_put_contents("{$g['varrun_path']}/filter_reload_status", $text);
+ if ($new) {
+ file_put_contents("{$g['varrun_path']}/filter_reload_status", $text . PHP_EOL);
+ } else {
+ file_put_contents("{$g['varrun_path']}/filter_reload_status", $text . PHP_EOL, FILE_APPEND);
+ }
}
/****** util/return_dir_as_array
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
index 51a16c3..51b8c57 100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
@@ -662,7 +662,6 @@ function step8_stepsubmitphpaction() {
/* And we're no longer dirty! */
clear_subsystem_dirty('shaper');
- update_filter_reload_status("Initializing");
header("Location: status_filter_reload.php");
exit;
}
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
index fbc01d4..52ea5f2 100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -728,7 +728,6 @@ function step8_stepsubmitphpaction() {
/* And we're no longer dirty! */
clear_subsystem_dirty('shaper');
- update_filter_reload_status("Initializing");
header("Location: status_filter_reload.php");
exit;
}
OpenPOWER on IntegriCloud