From 876a52e95a9d24a4b9fa37325d83bcb7d3c7b160 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Fri, 30 Jun 2023 11:22:52 +0200 Subject: test: fix filter-build test and bugs The tests for checking the filter build recompile and are successfull. Changes: - spotted a couple of bugs for adding the arguments in the filter - readded function `filter_flush_args` to flush_args; this is needed to distinguish when the arguments belong to the same block or are different entries to the same syscall - build the filter in a way that CMP_EQ corresponds to BPF_JEQ and we don't need to awkwardly negate the operations (still TODO for AND_EQ) --- cooker/emit.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'cooker/emit.c') diff --git a/cooker/emit.c b/cooker/emit.c index ee52b17..28afd29 100644 --- a/cooker/emit.c +++ b/cooker/emit.c @@ -559,8 +559,6 @@ void emit_bpf_arg(int index, enum type type, union value v, union value mask, */ if (mask.v_num) bpf.cmp = (cmp == CMP_EQ) ? AND_NE : AND_EQ; - else - bpf.cmp = (cmp == CMP_EQ) ? NE : EQ; bpf.arg = index; -- cgit v1.2.3