aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorPrashant Bhole2018-02-13 13:44:22 +0900
committerAlexei Starovoitov2018-02-13 17:46:53 -0800
commit444890c3ce7d74bdc20f2bf930b8476b98d3e972 (patch)
treeea919a7a88f8de9f4c77854bc37f9f12bb5f751e /samples
parent9492686c53f3a98e7027d1079db1471ab20e17de (diff)
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>
Diffstat (limited to 'samples')
-rw-r--r--samples/sockmap/sockmap_user.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap/sockmap_user.c
index 7c25c0c112bc..95a54a89a532 100644
--- a/samples/sockmap/sockmap_user.c
+++ b/samples/sockmap/sockmap_user.c
@@ -566,6 +566,7 @@ run:
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);