diff options
author | Can Erkin Acar <canacar@cvs.openbsd.org> | 2003-10-24 04:26:17 +0000 |
---|---|---|
committer | Can Erkin Acar <canacar@cvs.openbsd.org> | 2003-10-24 04:26:17 +0000 |
commit | 7243f4a3edf82f256c6d8bdcfe1278cc53c0fb2b (patch) | |
tree | 85ae47c7af66dec03f9930650aba1d658e0f6152 /sys/net | |
parent | ec2aff43fb81d2ca588e2e7a37ec7435009b365c (diff) |
Fix write filter blocking when no filter was set. Fixes
problems with dhcp.
ok frantzen@ krw@ deraadt@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/bpf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 3c171166439..b8686bb9aa1 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.40 2003/10/22 18:42:40 canacar Exp $ */ +/* $OpenBSD: bpf.c,v 1.41 2003/10/24 04:26:16 canacar Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* @@ -105,9 +105,9 @@ bpf_movein(uio, linktype, mp, sockp, filter) { struct mbuf *m; int error; - int len; - int hlen; - int slen; /* XXX u_int ? */ + u_int hlen; + u_int len; + u_int slen; /* * Build a sockaddr based on the data link layer type. @@ -168,7 +168,7 @@ bpf_movein(uio, linktype, mp, sockp, filter) } len = uio->uio_resid; - if ((unsigned)len > MCLBYTES) + if (len > MCLBYTES) return (EIO); MGETHDR(m, M_WAIT, MT_DATA); @@ -190,7 +190,7 @@ bpf_movein(uio, linktype, mp, sockp, filter) goto bad; slen = bpf_filter(filter, mtod(m, u_char *), len, len); - if (slen == 0 || slen < len) { + if (slen < len) { error = EPERM; goto bad; } |