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:
Augustin Cavalier
2022-06-07 14:41:15 -04:00
parent c146183167
commit 1cef8ebf6e
+1 -1
View File
@@ -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);