selftests/bpf: Check for correct program attach/detach in xdp_attach test
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 14 Apr 2020 14:50:25 +0000 (16:50 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 15 Apr 2020 11:26:08 +0000 (13:26 +0200)
commitc6c111523d9e697bfb463870759825be5d6caff6
treefb949e0ba4bb00676e818ac3d3a70efa62781a18
parent49b452c382da2c2d1ccee1265cbb92da905c82f7
selftests/bpf: Check for correct program attach/detach in xdp_attach test

David Ahern noticed that there was a bug in the EXPECTED_FD code so
programs did not get detached properly when that parameter was supplied.
This case was not included in the xdp_attach tests; so let's add it to be
sure that such a bug does not sneak back in down.

Fixes: 87854a0b57b3 ("selftests/bpf: Add tests for attaching XDP programs")
Reported-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200414145025.182163-2-toke@redhat.com
tools/testing/selftests/bpf/prog_tests/xdp_attach.c