diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2021-04-23 03:43:20 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2021-04-23 03:43:20 +0000 |
commit | 6b2232ee973abd9c52f15b14de0d0028c907c500 (patch) | |
tree | 8019b132510aea369dba719232c560b87384ed24 /sys | |
parent | 46f4bd04a6007b34edaaa55ffaeeb8b4d00b9300 (diff) |
call klist_invalidate from bpfsdetach to tell kq listeners what happened.
without this, something using a kevent to monitor a bpf fd on an
idle interface never has the event fire, which means it never
realises the interface goes away. with this, the read event goes
off and the next read fails with EIO, like pretty much every other
driver when the underlying device is removed.
ok claudio@ visa@ jmatthew@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/bpf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index fccc985e6d3..b78067a5428 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.203 2021/01/21 12:33:14 dlg Exp $ */ +/* $OpenBSD: bpf.c,v 1.204 2021/04/23 03:43:19 dlg Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* @@ -1690,8 +1690,10 @@ bpfsdetach(void *p) if (cdevsw[maj].d_open == bpfopen) break; - while ((bd = SMR_SLIST_FIRST_LOCKED(&bp->bif_dlist))) + while ((bd = SMR_SLIST_FIRST_LOCKED(&bp->bif_dlist))) { vdevgone(maj, bd->bd_unit, bd->bd_unit, VCHR); + klist_invalidate(&bd->bd_sel.si_note); + } for (tbp = bpf_iflist; tbp; tbp = tbp->bif_next) { if (tbp->bif_next == bp) { |