summaryrefslogtreecommitdiffstats
path: root/tools/regression/bpf/bpf_filter/bpf_test.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2008-08-28 22:41:31 +0000
committerjkim <jkim@FreeBSD.org>2008-08-28 22:41:31 +0000
commit1d9644cd1971cc45ecbdfab11f0f452a01645dfb (patch)
treeb0b45206ce87b2efaf85ba12989ab0bfa1d88d08 /tools/regression/bpf/bpf_filter/bpf_test.c
parenta98280bcbe8c44fd320269943dc275dba8090193 (diff)
downloadFreeBSD-src-1d9644cd1971cc45ecbdfab11f0f452a01645dfb.zip
FreeBSD-src-1d9644cd1971cc45ecbdfab11f0f452a01645dfb.tar.gz
Move comments to the right places.
Diffstat (limited to 'tools/regression/bpf/bpf_filter/bpf_test.c')
-rw-r--r--tools/regression/bpf/bpf_filter/bpf_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/regression/bpf/bpf_filter/bpf_test.c b/tools/regression/bpf/bpf_filter/bpf_test.c
index d39878a..91386d7 100644
--- a/tools/regression/bpf/bpf_filter/bpf_test.c
+++ b/tools/regression/bpf/bpf_filter/bpf_test.c
@@ -133,17 +133,17 @@ bpf_validate(const struct bpf_insn *f, int len)
return (1);
for (i = 0; i < len; ++i) {
- /*
- * Check that that jumps are forward, and within
- * the code block.
- */
p = &f[i];
/*
- * Check that the instruction is valid.
+ * Check that the code is valid.
*/
if ((p->code & 0xff00) ||
!(bpf_code_map[p->code >> 4] & (1 << (p->code & 0xf))))
return (0);
+ /*
+ * Check that that jumps are forward, and within
+ * the code block.
+ */
if (BPF_CLASS(p->code) == BPF_JMP) {
register int from = i + 1;
OpenPOWER on IntegriCloud