-
Notifications
You must be signed in to change notification settings - Fork 138
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
example: Add TCP header modification example #770
Conversation
- Replaced tabs with spaces for consistency - Removed unstable features - Modified handling of attachment result - Replaced verbose options and included trigger command in README.md
How can I install a plugin in VSCode or check the same rules in CI in some other way? :P |
You don't need VSCode, you can just do what the workflow does. So in your case check the clippy and/or rustfmt jobs: libbpf-rs/.github/workflows/test.yml Lines 185 to 205 in b47f48e
|
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.
Looks good to me now, thanks! Why did you remove the example from the workspace, though? I think it should stay there.
examples/tcp_option/src/main.rs
Outdated
println!("BPF Attached Successfully!"); | ||
} | ||
_ => { | ||
println!("Failed to Attach BPF, Reason: {:?}", Error::last_os_error()); |
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.
Should we exit here or is there a good reason for continuing as if nothing happened?
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.
Should I use panic or return Err or do you have a better suggestion?
panic!("Failed to Attach BPF, Reason: {:?}", Error::last_os_error());
// or
println!("Failed to Attach BPF, Reason: ");
return Err(Error::last_os_error().into());
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.
Return is probably best. Thanks!
I executed cmd and then got this
did I miss something... |
You may be using nightly
|
- add example to workspace - exit program when attach fails
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.
Looks good to me, thanks again!
Thank you very much for your help in this. 🥳 |
Old PR is: #767
Thank you for considering a contribution!
In order to streamline review experience for contributors and reviewers, please
be sure to read and follow the Contributor's Guide. It
lays out basic best practices, which, if followed will reduce unnecessary back
and forth and, ultimately, minimize the time it takes to get your change into
the library.