diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2020-04-07 13:27:53 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2020-04-07 13:27:53 +0000 |
commit | 31b8aeb32e081f42e1ec7f34094de4351458aed3 (patch) | |
tree | 620f7a0227efbc1b17d8b8e8b070acdf3c1c0436 /sys/net/if_tun.c | |
parent | a469bdd2f75259dda9613501bb83503033815c3c (diff) |
Abstract the head of knote lists. This allows extending the lists,
for example, with locking assertions.
OK mpi@, anton@
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index b05106c3b89..3b4567bbb19 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.219 2020/02/20 16:56:52 visa Exp $ */ +/* $OpenBSD: if_tun.c,v 1.220 2020/04/07 13:27:52 visa Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -1001,7 +1001,7 @@ tun_dev_kqfilter(dev_t dev, struct knote *kn) kn->kn_hook = (caddr_t)sc; /* XXX give the sc_ref to the hook? */ s = splhigh(); - SLIST_INSERT_HEAD(klist, kn, kn_selnext); + klist_insert(klist, kn); splx(s); put: @@ -1016,7 +1016,7 @@ filt_tunrdetach(struct knote *kn) struct tun_softc *sc = kn->kn_hook; s = splhigh(); - SLIST_REMOVE(&sc->sc_rsel.si_note, kn, knote, kn_selnext); + klist_remove(&sc->sc_rsel.si_note, kn); splx(s); } @@ -1038,7 +1038,7 @@ filt_tunwdetach(struct knote *kn) struct tun_softc *sc = kn->kn_hook; s = splhigh(); - SLIST_REMOVE(&sc->sc_wsel.si_note, kn, knote, kn_selnext); + klist_remove(&sc->sc_wsel.si_note, kn); splx(s); } |