From: Prashant Bhole Date: Thu, 20 Jun 2019 06:58:15 +0000 (+0900) Subject: samples/bpf: xdp_redirect, correctly get dummy program id X-Git-Tag: v5.3-rc1~96^2~14^2~20^2~11 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=20f6239d494b2ec7fcc9930eaab3e736a6a9419e;p=linux-block.git samples/bpf: xdp_redirect, correctly get dummy program id When we terminate xdp_redirect, it ends up with following message: "Program on iface OUT changed, not removing" This results in dummy prog still attached to OUT interface. It is because signal handler checks if the programs are the same that we had attached. But while fetching dummy_prog_id, current code uses prog_fd instead of dummy_prog_fd. This patch passes the correct fd. Fixes: 3b7a8ec2dec3 ("samples/bpf: Check the prog id before exiting") Signed-off-by: Prashant Bhole Acked-by: Toke Høiland-Jørgensen Signed-off-by: Daniel Borkmann --- diff --git a/samples/bpf/xdp_redirect_user.c b/samples/bpf/xdp_redirect_user.c index e9054c0269ff..1299e0f61dad 100644 --- a/samples/bpf/xdp_redirect_user.c +++ b/samples/bpf/xdp_redirect_user.c @@ -197,7 +197,7 @@ int main(int argc, char **argv) } memset(&info, 0, sizeof(info)); - ret = bpf_obj_get_info_by_fd(prog_fd, &info, &info_len); + ret = bpf_obj_get_info_by_fd(dummy_prog_fd, &info, &info_len); if (ret) { printf("can't get prog info - %s\n", strerror(errno)); return ret;