summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2007-10-18 21:53:21 +0000
committerBill Marquette <billm@pfsense.org>2007-10-18 21:53:21 +0000
commit84b28297752c9a99fdd20a318ebea1b3314234e0 (patch)
tree8cd7c73145c69ec4be627085610535b9f31ddd73 /usr
parentb4b3cf425bb0d8910b9bd04f57acadc959ef9a66 (diff)
downloadpfsense-84b28297752c9a99fdd20a318ebea1b3314234e0.zip
pfsense-84b28297752c9a99fdd20a318ebea1b3314234e0.tar.gz
Ticket #1494 - when wrapping at 32bits, the difference is 32bits - last + current, not some massive negative number
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/graph.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/usr/local/www/graph.php b/usr/local/www/graph.php
index f0230e6..d79a877 100755
--- a/usr/local/www/graph.php
+++ b/usr/local/www/graph.php
@@ -196,9 +196,19 @@ function plot_data(obj) {
return handle_error();
var diff_ugmt = ugmt - last_ugmt;
- var diff_ifin = ifin - last_ifin;
- var diff_ifout = ifout - last_ifout;
-
+ if (last_ifin < ifin) {
+ var diff_ifin = ifin - last_ifin;
+ } else {
+ real_last_ifin = (4294967296 - last_ifin)
+ var diff_ifin = ifin + real_last_ifin;
+ }
+ if (last_ifout < ifout) {
+ var diff_ifout = ifout - last_ifout;
+ } else {
+ real_last_ifout = (4294967296 - last_ifout)
+ var diff_ifout = ifout + real_last_ifout;
+ }
+
if (diff_ugmt == 0)
diff_ugmt = 1; /* avoid division by zero */
OpenPOWER on IntegriCloud