summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/gwlb.inc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-12-11 17:12:02 -0200
committerRenato Botelho <renato@netgate.com>2015-12-11 17:12:02 -0200
commitd8f89cce05688ab5d24653c9ebcd57e9d3f872dd (patch)
tree126333a526cecc54d9e802006d7654f26d8c910c /src/etc/inc/gwlb.inc
parent08e18c836c3b00ccb2ff888158963d1b4188fba5 (diff)
downloadpfsense-d8f89cce05688ab5d24653c9ebcd57e9d3f872dd.zip
pfsense-d8f89cce05688ab5d24653c9ebcd57e9d3f872dd.tar.gz
Use default values for latencylow and losslow when they are not defined by user. Reported by grandrivers at https://forum.pfsense.org/index.php?topic=103818.msg579069#msg579069
Diffstat (limited to 'src/etc/inc/gwlb.inc')
-rw-r--r--src/etc/inc/gwlb.inc25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc
index fc6a727..ab2d5a6 100644
--- a/src/etc/inc/gwlb.inc
+++ b/src/etc/inc/gwlb.inc
@@ -326,14 +326,27 @@ function get_dpinger_status($gwname) {
} else if ($r['alarm_on'] == 1) {
$r['status'] = "down";
} else if (isset($gw)) {
+ $dpinger_defaults = return_dpinger_defaults();
if (isset($gw['latencylow']) &&
- is_numeric($gw['latencylow']) &&
- ($r['latency_avg'] > $gw['latencylow'])) {
+ is_numeric($gw['latencylow'])) {
+ $latencylow = $gw['latencylow'];
+ } else {
+ $latencylow = $dpinger_defaults['latencylow'];
+ }
+
+ if ($r['latency_avg'] > $latencylow) {
$r['status'] = "delay";
- } else if (isset($gw['losslow']) &&
- is_numeric($gw['losslow']) &&
- ($r['loss'] > $gw['losslow'])) {
- $r['status'] = "loss";
+ } else {
+ if (isset($gw['losslow']) &&
+ is_numeric($gw['losslow'])) {
+ $losslow = $gw['losslow'];
+ } else {
+ $losslow = $dpinger_defaults['losslow'];
+ }
+
+ if ($r['loss'] > $losslow) {
+ $r['status'] = "loss";
+ }
}
}
OpenPOWER on IntegriCloud