bpf: samples/sockmap detach sock ops program

samples/sockops program keeps the sock_ops program attached to cgroup.
Fixed this by detaching program before exit.

Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Prashant Bhole 2018-02-13 13:44:22 +09:00 committed by Alexei Starovoitov
parent 9492686c53
commit 444890c3ce

View File

@ -566,6 +566,7 @@ int main(int argc, char **argv)
else
fprintf(stderr, "unknown test\n");
out:
bpf_prog_detach2(prog_fd[2], cg_fd, BPF_CGROUP_SOCK_OPS);
close(s1);
close(s2);
close(p1);