Skip to content

Commit

Permalink
bpf: samples/sockmap detach sock ops program
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Prashant Bhole authored and Alexei Starovoitov committed Feb 14, 2018
1 parent 9492686 commit 444890c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions samples/sockmap/sockmap_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 444890c

Please sign in to comment.