diff options
| author | 2020-03-10 09:11:55 +0000 | |
|---|---|---|
| committer | 2020-03-10 09:11:55 +0000 | |
| commit | 0ff90d0ee6bf8cbfc08765fc97c1eb76d677412f (patch) | |
| tree | 11bb6cc44f0cd5ffe0f6fd5968a8a1440b7133b2 | |
| parent | Make sure return value 'error' is initialized to '0'. (diff) | |
| download | wireguard-openbsd-0ff90d0ee6bf8cbfc08765fc97c1eb76d677412f.tar.xz wireguard-openbsd-0ff90d0ee6bf8cbfc08765fc97c1eb76d677412f.zip | |
Properly exit loop at end of hooks TAILQ.
Feedback from and ok dlg@
ok kn@ todd@
| -rw-r--r-- | sys/net/if.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 850d6e5abfc..74bac22cdc2 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.600 2020/01/24 05:14:51 jsg Exp $ */ +/* $OpenBSD: if.c,v 1.601 2020/03/10 09:11:55 tobhe Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1050,10 +1050,9 @@ if_hooks_run(struct task_list *hooks) mtx_enter(&if_hooks_mtx); for (t = TAILQ_FIRST(hooks); t != NULL; t = nt) { - while (t->t_func == NULL) { /* skip cursors */ - t = TAILQ_NEXT(t, t_entry); - if (t == NULL) - break; + if (t->t_func == NULL) { /* skip cursors */ + nt = TAILQ_NEXT(t, t_entry); + continue; } func = t->t_func; arg = t->t_arg; |
