summaryrefslogtreecommitdiff
path: root/sys/net/bpf_filter.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-09-13 12:09:54 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-09-13 12:09:54 +0000
commit3ad3d1a11d5ccde3a8c9194e041ba552d4d2555d (patch)
treeaa3df6bd34e36fd24210f3011b9d88d857aee1aa /sys/net/bpf_filter.c
parent019b1cc4c3a3a670fef4e88633e5fb0d4aabfb43 (diff)
Don't waste time zero'ing memory until there is some chance it might
be used. Also noted by dlg@. ok phessler@ mpi@
Diffstat (limited to 'sys/net/bpf_filter.c')
-rw-r--r--sys/net/bpf_filter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c
index 111de654490..45ca6a527f2 100644
--- a/sys/net/bpf_filter.c
+++ b/sys/net/bpf_filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf_filter.c,v 1.31 2016/09/12 14:05:40 krw Exp $ */
+/* $OpenBSD: bpf_filter.c,v 1.32 2016/09/13 12:09:53 krw Exp $ */
/* $NetBSD: bpf_filter.c,v 1.12 1996/02/13 22:00:00 christos Exp $ */
/*
@@ -148,8 +148,6 @@ _bpf_filter(const struct bpf_insn *pc, const struct bpf_ops *ops,
int32_t mem[BPF_MEMWORDS];
int err;
- bzero(mem, sizeof(mem));
-
if (pc == NULL) {
/*
* No filter means accept all.
@@ -157,6 +155,8 @@ _bpf_filter(const struct bpf_insn *pc, const struct bpf_ops *ops,
return (u_int)-1;
}
+ memset(mem, 0, sizeof(mem));
+
--pc;
while (1) {
++pc;