path: root/samples/bpf/xdp_redirect_map_user.c
diff options
authorToke Høiland-Jørgensen <>2019-02-21 17:05:39 +0100
committerDaniel Borkmann <>2019-02-22 16:21:59 +0100
commit915654fd718c2366871b19f8c6687e61909db911 (patch)
treef80fe5dae9fe4dc35db88369f64bf9183152644f /samples/bpf/xdp_redirect_map_user.c
parente80d02dd763093f70c3000ef34253a6d426becf6 (diff)
samples/bpf: Fix dummy program unloading for xdp_redirect samples
The xdp_redirect and xdp_redirect_map sample programs both load a dummy program onto the egress interfaces. However, the unload code checks these programs against the wrong id number, and thus refuses to unload them. Fix the comparison to avoid this. Fixes: 3b7a8ec2dec3 ("samples/bpf: Check the prog id before exiting") Signed-off-by: Toke Høiland-Jørgensen <> Acked-by: Maciej Fijalkowski <> Acked-by: Martin KaFai Lau <> Signed-off-by: Daniel Borkmann <>
Diffstat (limited to 'samples/bpf/xdp_redirect_map_user.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/xdp_redirect_map_user.c b/samples/bpf/xdp_redirect_map_user.c
index 327226be5a06..1dbe7fd3a1a8 100644
--- a/samples/bpf/xdp_redirect_map_user.c
+++ b/samples/bpf/xdp_redirect_map_user.c
@@ -57,7 +57,7 @@ static void int_exit(int sig)
printf("bpf_get_link_xdp_id failed\n");
- if (prog_id == curr_prog_id)
+ if (dummy_prog_id == curr_prog_id)
bpf_set_link_xdp_fd(ifindex_out, -1, xdp_flags);
else if (!curr_prog_id)
printf("couldn't find a prog id on iface OUT\n");