Module Name:    src
Committed By:   mrg
Date:           Sun Dec  5 22:40:56 UTC 2010

Modified Files:
        src/sys/net: bpf_filter.c

Log Message:
revert another part of bpf_filter 1.38 that broke the check for divide
by zero while validating the bpf program.

originally spotted by skrll@, and broke atf the month-old atf test for
this exact problem: net_bpf_t_div-by-zero_div_by_zero.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 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.40 src/sys/net/bpf_filter.c:1.41
--- src/sys/net/bpf_filter.c:1.40	Sun Dec  5 09:42:20 2010
+++ src/sys/net/bpf_filter.c	Sun Dec  5 22:40:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf_filter.c,v 1.40 2010/12/05 09:42:20 mrg Exp $	*/
+/*	$NetBSD: bpf_filter.c,v 1.41 2010/12/05 22:40:56 mrg 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.40 2010/12/05 09:42:20 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.41 2010/12/05 22:40:56 mrg Exp $");
 
 #if 0
 #if !(defined(lint) || defined(KERNEL))
@@ -529,7 +529,7 @@
 				/*
 				 * Check for constant division by 0.
 				 */
-				if (BPF_RVAL(p->code) == BPF_K && p->k == 0)
+				if (BPF_SRC(p->code) == BPF_K && p->k == 0)
 					return 0;
 				break;
 			default:

Reply via email to