svn commit: r212829 - head/usr.sbin/ppp

Nick Hibma n_hibma at FreeBSD.org
Sat Sep 18 22:26:50 UTC 2010


Author: n_hibma
Date: Sat Sep 18 22:26:50 2010
New Revision: 212829
URL: http://svn.freebsd.org/changeset/base/212829

Log:
  Bugfix: Reset the packet counters at the same time as the byte counts.
  
  Reviewed by:	brian
  MFC after:	3 weeks

Modified:
  head/usr.sbin/ppp/throughput.c

Modified: head/usr.sbin/ppp/throughput.c
==============================================================================
--- head/usr.sbin/ppp/throughput.c	Sat Sep 18 20:50:36 2010	(r212828)
+++ head/usr.sbin/ppp/throughput.c	Sat Sep 18 22:26:50 2010	(r212829)
@@ -201,7 +201,7 @@ throughput_start(struct pppThroughput *t
   for (i = 0; i < t->SamplePeriod; i++)
     t->in.SampleOctets[i] = t->out.SampleOctets[i] = 0;
   t->nSample = 0;
-  t->OctetsIn = t->OctetsOut = 0;
+  t->OctetsIn = t->OctetsOut = t->PacketsIn = t->PacketsOut = 0;
   t->in.OctetsPerSecond = t->out.OctetsPerSecond = t->BestOctetsPerSecond = 0;
   time(&t->BestOctetsPerSecondTime);
   t->downtime = 0;
@@ -268,7 +268,7 @@ throughput_clear(struct pppThroughput *t
       divisor = 1;
     prompt_Printf(prompt, "overall cleared (was %6qu bytes/sec)\n",
                   (t->OctetsIn + t->OctetsOut) / divisor);
-    t->OctetsIn = t->OctetsOut = 0;
+    t->OctetsIn = t->OctetsOut = t->PacketsIn = t->PacketsOut = 0;
     t->downtime = 0;
     time(&t->uptime);
   }


More information about the svn-src-all mailing list