Module Name: src
Committed By: rmind
Date: Thu Aug 2 20:13:24 UTC 2012
Modified Files:
src/sys/net: bpf_filter.c
Log Message:
bpf_filter: remove unnecessary memset(), add a comment.
To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/net/bpf_filter.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/bpf_filter.c
diff -u src/sys/net/bpf_filter.c:1.51 src/sys/net/bpf_filter.c:1.52
--- src/sys/net/bpf_filter.c:1.51 Wed Aug 1 23:24:29 2012
+++ src/sys/net/bpf_filter.c Thu Aug 2 20:13:24 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf_filter.c,v 1.51 2012/08/01 23:24:29 rmind Exp $ */
+/* $NetBSD: bpf_filter.c,v 1.52 2012/08/02 20:13:24 rmind Exp $ */
/*-
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.51 2012/08/01 23:24:29 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.52 2012/08/02 20:13:24 rmind Exp $");
#if 0
#if !(defined(lint) || defined(KERNEL))
@@ -149,7 +149,10 @@ bpf_filter(const struct bpf_insn *pc, co
return (u_int)-1;
}
- memset(mem, 0, sizeof(mem));
+ /*
+ * Note: safe to leave memwords uninitialised, as the validation
+ * step ensures that it will not be read, if it was not written.
+ */
A = 0;
X = 0;
--pc;