]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: xdp_redirect, correctly get dummy program id
authorPrashant Bhole <prashantbhole.linux@gmail.com>
Thu, 20 Jun 2019 06:58:15 +0000 (15:58 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 24 Jun 2019 13:56:56 +0000 (15:56 +0200)
commit49ed9579b079916413eba045c4a9b122fa61df7f
tree3f27dfa815127e390de915280f1061ec43c88ba1
parent580d79624b881449193d41fc83d19c564c8d5948
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: 93356610a66a ("samples/bpf: Check the prog id before exiting")
Signed-off-by: Prashant Bhole <prashantbhole.linux@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/xdp_redirect_user.c