]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
bpf: samples/sockmap detach sock ops program
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Tue, 13 Feb 2018 04:44:22 +0000 (13:44 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 14 Feb 2018 01:46:53 +0000 (17:46 -0800)
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>
samples/sockmap/sockmap_user.c

index 7c25c0c112bc1578fef071cd31e235ec9eaa01bc..95a54a89a5322a44ec17d727f78c8ec795c8631c 100644 (file)
@@ -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);