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
Set attach type during load for BPF_PROG_TYPE_CGROUP_SKB #263
Conversation
👷 Deploy request for aya-rs pending review.Visit the deploys page to approve it
|
As per title, this patch sets `expected_attach_type` during load.
a930af9
to
29c10fa
Compare
@nak3 Thanks for the PR! Does the current behaviour cause an issue (other than misleading strace output)? I'm not against the change at all... I just want to understand the motivation. |
aya/src/programs/cgroup_skb.rs
Outdated
@@ -62,6 +62,11 @@ pub struct CgroupSkb { | |||
impl CgroupSkb { | |||
/// Loads the program inside the kernel. | |||
pub fn load(&mut self) -> Result<(), ProgramError> { | |||
self.data.expected_attach_type = match self.expected_attach_type { |
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.
this should use map()
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.
Thank you! updated.
6207917
to
5d22869
Compare
Hi @dave-tucker Yes, one very small issue is caused. (Sorry I should explain it in the linked issue.) #[cgroup_skb(name="cgroup_skb_tmp", attach="egress")]
pub fn cgroup_skb_tmp(ctx: SkBuffContext) -> i32 {
3
} this (return
After applied this patch, the return value |
As per title, this patch sets
expected_attach_type
during load.Fix #262