Libbpf userspace function bpf_xdp_detach
Detach a BPF_PROG_TYPE_XDP
program that was previously attached via bpf_xdp_attach
.
Definition
int bpf_xdp_detach(int ifindex, __u32 flags, const struct bpf_xdp_attach_opts *opts);
Parameters
ifindex
: index of the network interface to detach the program fromflags
: flags to control the detachment behavioropts
: options to control the detachment, seestruct bpf_xdp_attach_opts
Flags
XDP_FLAGS_REPLACE
=(1U << 4)
- If set, remove the currently attached program, throw an error if no program is attached.
Return
Zero on success, or a negative error code on failure.
struct bpf_xdp_attach_opts
struct bpf_xdp_attach_opts {
size_t sz;
int old_prog_fd;
size_t :0;
};
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome