diff options
author | tobhe <tobhe@cvs.openbsd.org> | 2020-03-10 09:11:56 +0000 |
---|---|---|
committer | tobhe <tobhe@cvs.openbsd.org> | 2020-03-10 09:11:56 +0000 |
commit | fc1834a518ec6fed4ac3adf501399b6c184db031 (patch) | |
tree | 09e6e1cc037a4738168a0bf0fa65c597d798a143 | |
parent | ad4c20f15e0697d252439b09e0113832285cb54b (diff) |
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; |