freebsd_network: Fix ticks check in callout_reset.
"ticks" is the name of the global variable indicating time since system start; "_ticks" is the local variable. The confusion between the two caused every callout to be invoked as soon as it was instantiated. I am pretty surprised this was not noticed before. I only discovered it just now while working on the OpenBSD WiFi driver ports. Seems it has been broken like this for multiple years...
This commit is contained in:
@@ -186,7 +186,7 @@ callout_reset(struct callout *c, int _ticks, void (*func)(void *), void *arg)
|
||||
|
||||
TRACE("callout_reset %p, func %p, arg %p\n", c, c->c_func, c->c_arg);
|
||||
|
||||
if (ticks >= 0) {
|
||||
if (_ticks >= 0) {
|
||||
// reschedule or add this timer
|
||||
if (c->due <= 0)
|
||||
list_add_item(&sTimers, c);
|
||||
|
||||
Reference in New Issue
Block a user