From f8f02928d3e6785aacca70ab0dcd31ad0761ba74 Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sun, 11 Jan 2015 20:48:29 +0000 Subject: [PATCH] Fix an off by one in ppsratecheck(). If you asked for N=1 you'd get one, but for any N>1 you'd get N-1 packets/events per second. --- sys/kern/kern_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 4956af0417a..6ae0fb1a892 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -982,7 +982,7 @@ ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps) return (maxpps != 0); } else { (*curpps)++; /* NB: ignore potential overflow */ - return (maxpps < 0 || *curpps < maxpps); + return (maxpps < 0 || *curpps <= maxpps); } }