diff options
author | jkim <jkim@FreeBSD.org> | 2006-01-03 20:26:03 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2006-01-03 20:26:03 +0000 |
commit | ae104d9814b199542431e6bc4bd83c1a9efdde8a (patch) | |
tree | 39c7a2b61e95daae0a092f19a5bc00725b0b46a8 /sys/net/bpf_filter.c | |
parent | d339804fc16b1cfac17acb0d33520ec14d3b90da (diff) | |
download | FreeBSD-src-ae104d9814b199542431e6bc4bd83c1a9efdde8a.zip FreeBSD-src-ae104d9814b199542431e6bc4bd83c1a9efdde8a.tar.gz |
- Explicitly validate an empty filter to match bpf_filter() comment[1].
- Do not use BPF JIT compiler for an empty filter.
[1] Pointed out by: darrenr
Diffstat (limited to 'sys/net/bpf_filter.c')
-rw-r--r-- | sys/net/bpf_filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index 0a4c67e..40b54bf 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -521,7 +521,7 @@ bpf_validate(f, len) register const struct bpf_insn *p; if (len < 1) - return 0; + return 1; for (i = 0; i < len; ++i) { /* |