Add selftest validating all the attachment logic around BPF XDP link. Test also link updates and get_obj_info() APIs. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200722064603.3350758-9-andriin@fb.com
13 lines
233 B
C
13 lines
233 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (c) 2020 Facebook */
|
|
#include <linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
char LICENSE[] SEC("license") = "GPL";
|
|
|
|
SEC("xdp/handler")
|
|
int xdp_handler(struct xdp_md *xdp)
|
|
{
|
|
return 0;
|
|
}
|