diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-01-07 05:31:18 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-01-07 05:31:18 +0000 |
commit | 0d6c73dc33acfb75a85d91e7340cc6f7f253534e (patch) | |
tree | 1961795c43f091814d4748c59a2cc40a5f18c316 /sys/net/bpf.c | |
parent | b3d7fe65f90c08b02498624ed6f60596abb575b6 (diff) |
Make open(O_NONBLOCK) of tun, tap, and bpf behave like open+ioctl(FIONBIO)
problem noted by yasuoka@
ok yasuoka@ millert@
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r-- | sys/net/bpf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 86f5f6db879..167c5fe86c8 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.131 2015/12/05 10:07:55 tedu Exp $ */ +/* $OpenBSD: bpf.c,v 1.132 2016/01/07 05:31:17 guenther Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* @@ -341,6 +341,9 @@ bpfopen(dev_t dev, int flag, int mode, struct proc *p) d->bd_bufsize = bpf_bufsize; d->bd_sig = SIGIO; + if (flag & FNONBLOCK) + d->bd_rtout = -1; + D_GET(d); return (0); |