aya-rs / aya

Aya is an eBPF library for the Rust programming language, built with a focus on developer experience and operability.
https://aya-rs.dev/book/
Apache License 2.0
3.25k stars 290 forks source link

aya-ebpf: Add set_reply accessor to SockOpsContext #1020

Closed l2dy closed 2 months ago

l2dy commented 2 months ago

A sock_ops program should always return 1 on success, otherwise __cgroup_bpf_run_filter_sock_ops() would return -EPERM.

The reply fields of the bpf_sock_ops struct are there in case a bpf program needs to return a value. For example, BPF_SOCK_OPS_TIMEOUT_INIT and BPF_SOCK_OPS_RWND_INIT are invoked via tcp_call_bpf(), which returns sock_ops.reply on success.

This follows up commit 3f6b2507b6c5c0da19b3a7fe3145240c3bab3c69 to cover all common accessors.

netlify[bot] commented 2 months ago

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
Latest commit 95e1763e30e0dcfe1256ecd9e32ca27dd65342b4
Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/66d9d41faaa0f0000862df0a
Deploy Preview https://deploy-preview-1020--aya-rs-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.