Skip to content

KFunc bpf_dynptr_slice_rdwr

v6.4

Get a pointer to dynptr data up to len bytes for read write access.

Definition

If the dynptr doesn't have continuous data up to len bytes, or the dynptr is read only, return NULL.

void *bpf_dynptr_slice_rdwr(const struct bpf_dynptr *p, u32 offset, void *buffer__opt, u32 buffer__szk)

Note

The pointer returned by the kfunc may be NULL. Hence, it forces the user to do a NULL check on the pointer returned from the kfunc before making use of it (dereferencing or passing to another helper).

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

The following program types can make use of this kfunc:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome