bpf/selftests: Add check for updating XDP bpf_link with wrong program type
authorToke Høiland-Jørgensen <toke@redhat.com>
Fri, 7 Jan 2022 22:11:15 +0000 (23:11 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 11 Jan 2022 17:44:06 +0000 (09:44 -0800)
commit036a05f50bd777134b1955f400e8d24c0149fef4
treec128bcf26d072175917ad3dbe484207c6780a5b3
parent4b27480dcaa71e7ee9f56907e419c6a1511fd2b2
bpf/selftests: Add check for updating XDP bpf_link with wrong program type

Add a check to the xdp_link selftest that the kernel rejects replacing an
XDP program with a different program type on link update.

v2:
- Split this out into its own patch.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20220107221115.326171-3-toke@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/xdp_link.c
tools/testing/selftests/bpf/progs/test_xdp_link.c