summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/conf.default/config.xml2
-rw-r--r--src/etc/inc/globals.inc2
-rw-r--r--src/etc/inc/gmirror.inc4
-rw-r--r--src/etc/inc/rrd.inc12
-rw-r--r--src/etc/inc/upgrade_config.inc70
-rw-r--r--src/usr/local/www/firewall_rules_edit.php33
-rw-r--r--src/usr/local/www/pkg_edit.php7
-rw-r--r--src/usr/local/www/status_rrd_graph_img.php25
-rw-r--r--src/usr/local/www/system.php7
9 files changed, 139 insertions, 23 deletions
diff --git a/src/conf.default/config.xml b/src/conf.default/config.xml
index f1bee76..1cc6b92 100644
--- a/src/conf.default/config.xml
+++ b/src/conf.default/config.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<pfsense>
- <version>14.5</version>
+ <version>14.6</version>
<lastchange/>
<system>
<optimization>normal</optimization>
diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc
index 235e14d..fda3529 100644
--- a/src/etc/inc/globals.inc
+++ b/src/etc/inc/globals.inc
@@ -99,7 +99,7 @@ $g = array(
"disablecrashreporter" => false,
"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
"debug" => false,
- "latest_config" => "14.5",
+ "latest_config" => "14.6",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "101",
"minimum_ram_warning_text" => "128 MB",
diff --git a/src/etc/inc/gmirror.inc b/src/etc/inc/gmirror.inc
index c183282..8ac173a 100644
--- a/src/etc/inc/gmirror.inc
+++ b/src/etc/inc/gmirror.inc
@@ -284,7 +284,7 @@ function gmirror_get_consumer_metadata($consumer) {
if (!is_valid_consumer($consumer)) {
return array();
}
- $output = "";
+ $output = array();
exec("/sbin/gmirror dump " . escapeshellarg($consumer), $output);
return array_map('trim', $output);
}
@@ -341,7 +341,7 @@ function gmirror_get_all_unused_consumer_sizes_on_disk($disk) {
if (!is_valid_disk($disk) || !is_consumer_unused($disk)) {
return array();
}
- $output = "";
+ $output = array();
exec("/sbin/geom part list " . escapeshellarg($disk) . " | /usr/bin/egrep '(Name:|Mediasize:)' | /usr/bin/cut -c4- | /usr/bin/sed -l -e 'N;s/\\nMediasize://;P;D;' | /usr/bin/cut -c7-", $output);
if (empty($output)) {
exec("/sbin/geom disk list " . escapeshellarg($disk) . " | /usr/bin/egrep '(Name:|Mediasize:)' | /usr/bin/cut -c4- | /usr/bin/sed -l -e 'N;s/\\nMediasize://;P;D;' | /usr/bin/cut -c7-", $output);
diff --git a/src/etc/inc/rrd.inc b/src/etc/inc/rrd.inc
index 29411aa..690f6cb 100644
--- a/src/etc/inc/rrd.inc
+++ b/src/etc/inc/rrd.inc
@@ -1008,6 +1008,7 @@ for sock in {$g['varrun_path']}/dpinger_*.sock; do
gw=\$(echo "\$t" | awk '{ print \$1 }')
delay=\$(echo "\$t" | awk '{ print \$2 }')
+ stddev=\$(echo "\$t" | awk '{ print \$3 }')
loss=\$(echo "\$t" | awk '{ print \$4 }')
if echo "\$loss" | grep -Eqv '^[0-9]+\$'; then
@@ -1019,20 +1020,27 @@ for sock in {$g['varrun_path']}/dpinger_*.sock; do
# Convert delay to millisecond
delay=\$(echo "scale=7; \$delay / 1000 / 1000" | /usr/bin/bc)
fi
+ if echo "\$stddev" | grep -Eqv '^[0-9]+\$'; then
+ stddev="U"
+ else
+ # Convert stddev to millisecond
+ stddev=\$(echo "scale=7; \$stddev / 1000 / 1000" | /usr/bin/bc)
+ fi
if [ ! -f {$rrddbpath}\$gw-quality.rrd ]; then
{$rrdtool} create {$rrddbpath}\$gw-quality.rrd --step 60 \\
DS:loss:GAUGE:120:0:100 \\
DS:delay:GAUGE:120:0:100000 \\
+ DS:stddev:GAUGE:120:0:100000 \\
RRA:AVERAGE:0.5:1:1200 \\
RRA:AVERAGE:0.5:5:720 \\
RRA:AVERAGE:0.5:60:1860 \\
RRA:AVERAGE:0.5:1440:2284
- {$rrdtool} update {$rrddbpath}\$gw-quality.rrd -t loss:delay N:U:U
+ {$rrdtool} update {$rrddbpath}\$gw-quality.rrd -t loss:delay:stddev N:U:U:U
fi
- {$rrdtool} update {$rrddbpath}\$gw-quality.rrd -t loss:delay N:\$loss:\$delay
+ {$rrdtool} update {$rrddbpath}\$gw-quality.rrd -t loss:delay:stddev N:\$loss:\$delay:\$stddev
done
EOD;
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc
index fd31a0a..403bc55 100644
--- a/src/etc/inc/upgrade_config.inc
+++ b/src/etc/inc/upgrade_config.inc
@@ -56,6 +56,9 @@
if (!function_exists("dump_rrd_to_xml")) {
require("rrd.inc");
}
+if (!function_exists("read_altq_config")) {
+ require("shaper.inc");
+}
/* Upgrade functions must be named:
* upgrade_XXX_to_YYY
@@ -4588,4 +4591,71 @@ function upgrade_144_to_145() {
}
}
+function upgrade_145_to_146() {
+ // Add standard deviation to the quality rrds
+ global $config, $g;
+
+ $rrddbpath = "/var/db/rrd";
+ $rrdtool = "/usr/local/bin/rrdtool";
+
+ $awkcmd = "/usr/bin/awk '";
+ $awkcmd .= "{\n";
+ $awkcmd .= " if (sub(/<\\/v><\\/row>/, \"</v><v>NaN</v></row>\") == 0)\n";
+ $awkcmd .= " {\n";
+ $awkcmd .= " if (/<\\/cdp_prep>/)\n";
+ $awkcmd .= " {\n";
+ $awkcmd .= " print \" <ds>\"\n";
+ $awkcmd .= " print \" <primary_value> 0.0000000000e+00 </primary_value>\"\n";
+ $awkcmd .= " print \" <secondary_value> 0.0000000000e+00 </secondary_value>\"\n";
+ $awkcmd .= " print \" <value> NaN </value>\"\n";
+ $awkcmd .= " print \" <unknown_datapoints> 0 </unknown_datapoints>\"\n";
+ $awkcmd .= " print \" </ds>\"\n";
+ $awkcmd .= " }\n";
+ $awkcmd .= " else if (/<!-- Round Robin Archives -->/)\n";
+ $awkcmd .= " {\n";
+ $awkcmd .= " print \" <ds>\"\n";
+ $awkcmd .= " print \" <name> stddev </name>\"\n";
+ $awkcmd .= " print \" <type> GAUGE </type>\"\n";
+ $awkcmd .= " print \" <minimal_heartbeat> 120 </minimal_heartbeat>\"\n";
+ $awkcmd .= " print \" <min> 0.0000000000e+00 </min>\"\n";
+ $awkcmd .= " print \" <max> 1.0000000000e+05 </max>\\n\"\n";
+ $awkcmd .= " print \" <!-- PDP Status -->\"\n";
+ $awkcmd .= " print \" <last_ds> 0 </last_ds>\"\n";
+ $awkcmd .= " print \" <value> 0.0000000000e+00 </value>\"\n";
+ $awkcmd .= " print \" <unknown_sec> 0 </unknown_sec>\"\n";
+ $awkcmd .= " print \" </ds>\\n\"\n";
+ $awkcmd .= " }\n";
+ $awkcmd .= " }\n";
+ $awkcmd .= " print;\n";
+ $awkcmd .= "}'";
+
+ if ($g['platform'] != $g['product_name']) {
+ /* restore the databases, if we have one */
+ if (restore_rrd()) {
+ /* Make sure to move the rrd backup out of the way. We will make a new one after converting. */
+ @rename("{$g['cf_conf_path']}/rrd.tgz", "{$g['cf_conf_path']}/backup/rrd.tgz");
+ }
+ }
+
+ $databases = return_dir_as_array($rrddbpath, '/-quality\.rrd$/');
+ foreach ($databases as $database) {
+ $xmldump = "{$g['tmp_path']}/{$database}.xml";
+
+ if (platform_booting()) {
+ echo "Update RRD database {$database}.\n";
+ }
+
+ exec("$rrdtool dump {$rrddbpath}/{$database} | {$awkcmd} > {$xmldump}");
+ exec("$rrdtool restore -f {$xmldump} {$rrddbpath}/{$database}");
+ @unlink("{$xmldump}");
+ }
+
+ if (!platform_booting()) {
+ enable_rrd_graphing();
+ }
+ /* Let's save the RRD graphs after we run enable RRD graphing */
+ /* The function will restore the rrd.tgz so we will save it after */
+ exec("cd /; LANG=C NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='{$g['cf_conf_path']}' /etc/rc.backup_rrd.sh");
+}
+
?>
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index 9ad9efa..c7675ef 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -907,16 +907,45 @@ if ($_POST) {
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_write_config");
if (isset($id) && $a_filter[$id]) {
- $a_filter[$id] = $filterent;
+ $tmpif = $filterent['interface'];
+ if (($tmpif == $if) || (isset($pconfig['floating']))) {
+ $a_filter[$id] = $filterent;
+ } else { // rule moved to different interface
+ // Update the separators of previous interface.
+ $a_separators = &$config['filter']['separator'][strtolower($if)];
+ $ridx = ifridx($if, $id); // get rule index within interface
+ $mvnrows = -1;
+ move_separators($a_separators, $ridx, $mvnrows);
+
+ $a_filter[$id] = $filterent; // save edited rule to new interface
+
+ // Update the separators of new interface.
+ $a_separators = &$config['filter']['separator'][strtolower($tmpif)];
+ $ridx = ifridx($tmpif, $id); // get rule index within interface
+ if ($ridx == 0) { // rule was placed at the top
+ $ridx = -1; // move all separators
+ }
+ $mvnrows = +1;
+ move_separators($a_separators, $ridx, $mvnrows);
+ }
+
} else {
$filterent['created'] = make_config_revision_entry();
if (is_numeric($after)) {
array_splice($a_filter, $after+1, 0, array($filterent));
- // For copy/dup the $if var is taken from the rule.
+ // For copy/dup the $if var is taken from the rule submission.
// In the case of floating rules that could be anything. But never "FloatingRules" that is needed.
if (isset($pconfig['floating'])) {
$tmpif = 'FloatingRules';
+ } else if (isset($filterent['interface'])) {
+ $tmpif = $filterent['interface'];
+ if ($tmpif != $if) { // rule copied to different interface
+ $ridx = ifridx($tmpif, $after+1); // get rule index within interface
+ if ($ridx == 0) { // rule was placed at the top
+ $after = -1; // move all separators
+ }
+ }
} else {
$tmpif = $if;
}
diff --git a/src/usr/local/www/pkg_edit.php b/src/usr/local/www/pkg_edit.php
index 9792df0..178b731 100644
--- a/src/usr/local/www/pkg_edit.php
+++ b/src/usr/local/www/pkg_edit.php
@@ -922,6 +922,7 @@ foreach ($pkg['fields']['field'] as $pkga) {
}
}
+ $descr = (isset($pkga['description'])) ? $pkga['description'] : "";
if ($grouping) {
$group->add(new Form_Select(
$pkga['fieldname'],
@@ -929,7 +930,7 @@ foreach ($pkg['fields']['field'] as $pkga) {
isset($pkga['multiple']) ? $srcselected:$srcselected[0],
$srcoptions,
isset($pkga['multiple'])
- ))->setOnchange($onchange);
+ ))->setHelp($descr)->setOnchange($onchange);
} else {
if (isset($pkga['advancedfield']) && isset($advfield_count)) {
$advanced->addInput(new Form_Select(
@@ -938,7 +939,7 @@ foreach ($pkg['fields']['field'] as $pkga) {
isset($pkga['multiple']) ? $srcselected:$srcselected[0],
$srcoptions,
isset($pkga['multiple'])
- ))->setOnchange($onchange);
+ ))->setHelp($descr)->setOnchange($onchange);
} else {
$section->addInput(new Form_Select(
$pkga['fieldname'],
@@ -946,7 +947,7 @@ foreach ($pkg['fields']['field'] as $pkga) {
isset($pkga['multiple']) ? $srcselected:$srcselected[0],
$srcoptions,
isset($pkga['multiple'])
- ))->setOnchange($onchange);
+ ))->setHelp($descr)->setOnchange($onchange);
}
}
diff --git a/src/usr/local/www/status_rrd_graph_img.php b/src/usr/local/www/status_rrd_graph_img.php
index df3f3c3..ffb2508 100644
--- a/src/usr/local/www/status_rrd_graph_img.php
+++ b/src/usr/local/www/status_rrd_graph_img.php
@@ -263,6 +263,8 @@ $colorqueuesdropdown = array('000000', '7B7B7B', '999999', 'BBBBBB', 'CCCCCC', '
/* Quality Graph Delay >420, 180-420, 60-180, 20-60, <20, Delay Avg */
$colorqualityrtt = array('990000', 'a83c3c', 'b36666', 'bd9090', 'cccccc', '000000');
+/* Quality Graph Standard Deviation */
+$colorqualitystddev = '55333355';
/* Quality Graph Loss */
$colorqualityloss = 'ee0000';
@@ -1074,29 +1076,36 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
--height 200 --width 620 \\
--lower-limit 0 \\
DEF:delayraw=$rrddbpath$curdatabase:delay:AVERAGE:step=$step \\
+ DEF:stddevraw=$rrddbpath$curdatabase:stddev:AVERAGE:step=$step \\
DEF:loss=$rrddbpath$curdatabase:loss:AVERAGE:step=$step \\
\"CDEF:delay=delayraw,1000,*\" \\
+ \"CDEF:stddev=stddevraw,1000,*\" \\
\"CDEF:loss10=loss,$multiplier,*\" \\
\"CDEF:r0=delay,20,MIN\" \\
\"CDEF:r1=delay,60,MIN\" \\
\"CDEF:r2=delay,180,MIN\" \\
\"CDEF:r3=delay,420,MIN\" \\
- COMMENT:\"\t\t\t\t\tDelay\t\t\t\tPacket loss\\n\" \\
+ COMMENT:\"\t\t\t\t\tDelay\t\t\t\tStddev\t\t\t Loss\\n\" \\
AREA:delay#$colorqualityrtt[0]:\"> 420 ms\" \\
- GPRINT:delay:MIN:\"\t\tMin\\: %7.2lf ms\" \\
- GPRINT:loss:MIN:\"\tMin\\: %3.1lf %%\\n\" \\
+ GPRINT:delay:MIN:\"\t\t Min\\: %7.2lf ms\" \\
+ GPRINT:stddev:MIN:\"\t Min\\: %7.2lf ms\" \\
+ GPRINT:loss:MIN:\"\t Min\\: %4.1lf %%\\n\" \\
AREA:r3#$colorqualityrtt[1]:\"180-420 ms\" \\
- GPRINT:delay:AVERAGE:\"\t\tAvg\\: %7.2lf ms\" \\
- GPRINT:loss:AVERAGE:\"\tAvg\\: %3.1lf %%\\n\" \\
+ GPRINT:delay:AVERAGE:\"\t\t Avg\\: %7.2lf ms\" \\
+ GPRINT:stddev:AVERAGE:\"\t Avg\\: %7.2lf ms\" \\
+ GPRINT:loss:AVERAGE:\"\t Avg\\: %4.1lf %%\\n\" \\
AREA:r2#$colorqualityrtt[2]:\"60-180 ms\" \\
- GPRINT:delay:MAX:\"\t\tMax\\: %7.2lf ms\" \\
- GPRINT:loss:MAX:\"\tMax\\: %3.1lf %%\\n\" \\
+ GPRINT:delay:MAX:\"\t\t Max\\: %7.2lf ms\" \\
+ GPRINT:stddev:MAX:\"\t Max\\: %7.2lf ms\" \\
+ GPRINT:loss:MAX:\"\t Max\\: %4.1lf %%\\n\" \\
AREA:r1#$colorqualityrtt[3]:\"20-60 ms\\n\" \\
AREA:r0#$colorqualityrtt[4]:\"< 20 ms\" \\
GPRINT:delay:LAST:\"\t\tLast\\: %7.2lf ms\" \\
- GPRINT:loss:LAST:\"\tLast\: %3.1lf %%\\n\" \\
+ GPRINT:stddev:LAST:\"\tLast\\: %7.2lf ms\" \\
+ GPRINT:loss:LAST:\"\tLast\: %4.1lf %%\\n\" \\
AREA:loss10#$colorqualityloss:\"Packet loss\\n\" \\
LINE1:delay#$colorqualityrtt[5]:\"Delay average\\n\" \\
+ LINE1:stddev#$colorqualitystddev:\"Stddev average\\n\" \\
COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\"";
} elseif ((strstr($curdatabase, "spamd.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
/* graph a spamd statistics graph */
diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php
index 61e44c2..884ab4c 100644
--- a/src/usr/local/www/system.php
+++ b/src/usr/local/www/system.php
@@ -175,14 +175,13 @@ if ($_POST) {
$input_errors[] = gettext("The domain may only contain the characters a-z, 0-9, '-' and '.'.");
}
- $ignore_posted_dnsgw = array();
+ $dnslist = $ignore_posted_dnsgw = array();
for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
$dnsname="dns{$dnscounter}";
$dnsgwname="dns{$dnscounter}gw";
- if ($_POST[$dnsname]) {
- $dnslist[] = $_POST[$dnsname];
- }
+ $dnslist[] = $_POST[$dnsname];
+
if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
$input_errors[] = sprintf(gettext("A valid IP address must be specified for DNS server %s."), $dnscounter);
} else {
OpenPOWER on IntegriCloud