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.
This commit is contained in:
mrg 2010-12-05 22:40:56 +00:00
parent 99f70917f1
commit f705e59458
1 changed files with 3 additions and 3 deletions

View File

@ -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 @@ bpf_validate(const struct bpf_insn *f, int signed_len)
/*
* 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: