OSDN Git Service

selftests/bpf: add prog detach to flow_dissector test
authorStanislav Fomichev <sdf@google.com>
Tue, 14 May 2019 21:12:34 +0000 (14:12 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 15 May 2019 23:33:33 +0000 (01:33 +0200)
In case we are not running in a namespace (which we don't do by default),
let's try to detach the bpf program that we use for eth_get_headlen tests.

Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode")
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/prog_tests/flow_dissector.c

index d40cee0..fbd1d88 100644 (file)
@@ -264,5 +264,6 @@ void test_flow_dissector(void)
                CHECK_FLOW_KEYS(tests[i].name, flow_keys, tests[i].keys);
        }
 
+       bpf_prog_detach(prog_fd, BPF_FLOW_DISSECTOR);
        bpf_object__close(obj);
 }