Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net revert another part of bpf_filter 1.38 that broke th...



details:   https://anonhg.NetBSD.org/src/rev/5aabfd8988dd
branches:  trunk
changeset: 759327:5aabfd8988dd
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Dec 05 22:40:56 2010 +0000

description:
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.

diffstat:

 sys/net/bpf_filter.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 322e76c0f309 -r 5aabfd8988dd sys/net/bpf_filter.c
--- a/sys/net/bpf_filter.c      Sun Dec 05 22:01:23 2010 +0000
+++ b/sys/net/bpf_filter.c      Sun Dec 05 22:40:56 2010 +0000
@@ -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:



Home | Main Index | Thread Index | Old Index