Skip to content

aya: add support for netkit attachments#1553

Open
rcanderson23 wants to merge 2 commits into
aya-rs:mainfrom
rcanderson23:netkit-attachments
Open

aya: add support for netkit attachments#1553
rcanderson23 wants to merge 2 commits into
aya-rs:mainfrom
rcanderson23:netkit-attachments

Conversation

@rcanderson23

@rcanderson23 rcanderson23 commented Apr 27, 2026

Copy link
Copy Markdown

Adds support for netkit primary and peer attachments. This refactors the
attachments from one that covers tc and tcx and hiding the attachment
type from the user to making the user explicitly choose which attachment
they are using.

Added/updated tests?

We strongly encourage you to add a test for your changes.

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Checklist

  • Rust code has been formatted with cargo +nightly fmt.
  • All clippy lints have been fixed.
    You can find failing lints with cargo xtask clippy.
  • Unit tests are passing locally with cargo test.
  • The Integration tests are passing locally.
  • I have blessed any API changes with cargo xtask public-api --bless.

(Optional) What GIF best describes this PR or how it makes you feel?


This change is Reviewable

@netlify

netlify Bot commented Apr 27, 2026

Copy link
Copy Markdown

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 29d185f
🔍 Latest deploy log https://app.netlify.com/projects/aya-rs-docs/deploys/6a0bd79b7f059a0008b8ee52
😎 Deploy Preview https://deploy-preview-1553--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@rcanderson23 rcanderson23 force-pushed the netkit-attachments branch 3 times, most recently from 918dbeb to 4dda68b Compare April 27, 2026 20:28
@rcanderson23 rcanderson23 marked this pull request as ready for review April 27, 2026 20:46
@rcanderson23 rcanderson23 requested a review from a team as a code owner April 27, 2026 20:46
Adds support for netkit primary and peer attachments. This refactors the
attachments from one that covers tc and tcx and hiding the attachment
type from the user to making the user explicitly choose which attachment
they are using.

Closes: aya-rs#1540
Adds netkit and ifindex helpers for netkit related tests.
Adds query_netkit to match query_tcx used in integration tests.
mccormickt added a commit to mccormickt/aurae that referenced this pull request Jun 10, 2026
…a tcx

The daemon now loads the guard-tcx-cell-net classifier once at network
init (degrading with a warning when the object is missing — the
pre-guard behavior) and activates it per cell inside
create_cell_interface: insert the cell's policy/redirect/stats map
entries, attach at tc(x) ingress on the netkit primary, and only then
move the peer into the cell netns — so a cell can never emit
unfiltered traffic. Guard activation failure is fatal for that cell:
when the guard exists we never hand out an unguarded interface.

cell_interfaces now tracks per-cell state (primary name, ifindex,
delegated prefix, owned tc link) instead of just the name, and the new
reclaim_cell_interface_sync() detaches the link and removes map
entries synchronously so non-async teardown paths can reuse it.

Attachment uses aya's stock SchedClassifier, which picks the TCX
multi-prog API on kernels >= 6.6. Once aya lands netkit link support
(aya-rs/aya#1553) the same program can move to the
BPF_NETKIT_PRIMARY/PEER hooks without bytecode changes.
mccormickt added a commit to mccormickt/aurae that referenced this pull request Jun 10, 2026
…a tcx

The daemon now loads the guard-tcx-cell-net classifier once at network
init (degrading with a warning when the object is missing — the
pre-guard behavior) and activates it per cell inside
create_cell_interface: insert the cell's policy/redirect/stats map
entries, attach at tc(x) ingress on the netkit primary, and only then
move the peer into the cell netns — so a cell can never emit
unfiltered traffic. Guard activation failure is fatal for that cell:
when the guard exists we never hand out an unguarded interface.

cell_interfaces now tracks per-cell state (primary name, ifindex,
delegated prefix, owned tc link) instead of just the name, and the new
reclaim_cell_interface_sync() detaches the link and removes map
entries synchronously so non-async teardown paths can reuse it.

Attachment uses aya's stock SchedClassifier, which picks the TCX
multi-prog API on kernels >= 6.6. Once aya lands netkit link support
(aya-rs/aya#1553) the same program can move to the
BPF_NETKIT_PRIMARY/PEER hooks without bytecode changes.
mccormickt added a commit to mccormickt/aurae that referenced this pull request Jun 10, 2026
…a tcx

The daemon now loads the guard-tcx-cell-net classifier once at network
init (degrading with a warning when the object is missing — the
pre-guard behavior) and activates it per cell inside
create_cell_interface: insert the cell's policy/redirect/stats map
entries, attach at tc(x) ingress on the netkit primary, and only then
move the peer into the cell netns — so a cell can never emit
unfiltered traffic. Guard activation failure is fatal for that cell:
when the guard exists we never hand out an unguarded interface.

cell_interfaces now tracks per-cell state (primary name, ifindex,
delegated prefix, owned tc link) instead of just the name, and the new
reclaim_cell_interface_sync() detaches the link and removes map
entries synchronously so non-async teardown paths can reuse it.

Attachment uses aya's stock SchedClassifier, which picks the TCX
multi-prog API on kernels >= 6.6. Once aya lands netkit link support
(aya-rs/aya#1553) the same program can move to the
BPF_NETKIT_PRIMARY/PEER hooks without bytecode changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant