Files
xdp-project-bpf-examples/bpf-link-hang/xdp-pass.c
Toke Høiland-Jørgensen 25acd99b58 Add example to show hang on bpf_link close
Minimal example to show that the close() operation on a bpf_link can hang
indefinitely if the kernel is loaded (for example by traffic on an
interface with an XDP program loaded).

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-03-23 00:09:44 +01:00

14 lines
240 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>
SEC("xdp/pass")
int xdp_pass(struct xdp_md *ctx)
{
return XDP_PASS;
}
char _license[] SEC("license") = "GPL";