From ace1a2c86f54529dac7f3db51c2d914826126fff Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 21 Apr 2010 02:20:48 -0700 Subject: Fix check for a constant 0 argument to BPF_DIV. BPV_RVAL() is the macro to check the type of the return value of a "ret" instruction; it tests more bits than are appropriate for a "div" instruction, and the test fails. --- bpf/net/bpf_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bpf/net/bpf_filter.c b/bpf/net/bpf_filter.c index a51ed78..22aff79 100644 --- a/bpf/net/bpf_filter.c +++ b/bpf/net/bpf_filter.c @@ -608,7 +608,7 @@ bpf_validate(f, 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: -- cgit v1.2.3