-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve AF_XDP test #846
base: main
Are you sure you want to change the base?
Improve AF_XDP test #846
Conversation
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
// Check whether incoming packet's queue ID matches the queue ID of the socket in XSKMAP at index `queue_id`. | ||
if SOCKS.get(queue_id) == Some(queue_id) { | ||
// Queue ID matches, redirect to AF_XDP socket. | ||
SOCKS.redirect(0, 0).unwrap_or(xdp_action::XDP_ABORTED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be SOCKS.redirect(queue_id, 0)
? The test will still work as veth only has one queue, but since we're after correctness, this feels like it's missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I changed it accordingly.
assume_init_mut()
on uninitialized memory causes UB. By usingzeroed()
the memory is guaranteed to be zero and with that is properly initialized foru8
.This change is