libbpf: Add function to set link XDP fd while specifying old program

This adds a new function to set the XDP fd while specifying the FD of the
program to replace, using the newly added IFLA_XDP_EXPECTED_FD netlink
parameter. The new function uses the opts struct mechanism to be extendable
in the future.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/158515700857.92963.7052131201257841700.stgit@toke.dk
This commit is contained in:
Toke Høiland-Jørgensen
2020-03-25 18:23:28 +01:00
committed by Alexei Starovoitov
parent 50a3e678b5
commit bd5ca3ef93
3 changed files with 42 additions and 1 deletions

View File

@@ -244,4 +244,5 @@ LIBBPF_0.0.8 {
bpf_link__pin_path;
bpf_link__unpin;
bpf_program__set_attach_target;
bpf_set_link_xdp_fd_opts;
} LIBBPF_0.0.7;