summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2016-09-13 12:09:53 +0000
committerkrw <krw@openbsd.org>2016-09-13 12:09:53 +0000
commit8d15695608ce2b88ffbc534edb201cc53fcc4f93 (patch)
treeb0c71a60f3739f587a3b2e31374dad4ecdb4a56a
parentDisable the timer event before attempting to change it (diff)
downloadwireguard-openbsd-8d15695608ce2b88ffbc534edb201cc53fcc4f93.tar.xz
wireguard-openbsd-8d15695608ce2b88ffbc534edb201cc53fcc4f93.zip
Don't waste time zero'ing memory until there is some chance it might
be used. Also noted by dlg@. ok phessler@ mpi@
-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;