mirror of
https://github.com/opnsense/src.git
synced 2026-04-02 07:55:21 -04:00
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.
This commit is contained in:
parent
6b7c46afec
commit
f8f02928d3
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue