Skip to content
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

pnet_macros: fix num_bytes calculation #547

Merged
merged 3 commits into from Apr 8, 2022

Conversation

yu-re-ka
Copy link
Contributor

@yu-re-ka yu-re-ka commented Apr 4, 2022

The following would panic in debug-mode, and produce garbage in release-mode:

#[packet]
pub struct Test {
    banana: u2,
    apple: u4,
    potato: u6,
    the_rest: u20be,
    #[payload]
    payload: Vec<u8>,
}

@stappersg
Copy link
Contributor

Warning: "github" squashes commits by default.

I think the two commits in this merge request should go in two separate commits.

@yu-re-ka
Copy link
Contributor Author

yu-re-ka commented Apr 6, 2022

@mrmonday can you have a look?

@mrmonday
Copy link
Contributor

mrmonday commented Apr 7, 2022

Could you add your sample struct into pnet_macros/tests/run-pass/ please?

Sorry for the delay.

@mrmonday
Copy link
Contributor

mrmonday commented Apr 7, 2022

In future, the best way to get my attention is to ping me on IRC (#libpnet on irc.libera.chat) - github notifications have a habit of getting buried in my inbox :)

@yu-re-ka
Copy link
Contributor Author

yu-re-ka commented Apr 8, 2022

Could you add your sample struct into pnet_macros/tests/run-pass/ please?

Done

Sorry for the delay.

A few days are not a problem, if it gets into the weeks we should maybe talk about adding some more maintainers ;)

@mrmonday
Copy link
Contributor

mrmonday commented Apr 8, 2022

I keep adding new maintainers, they always seem to disappear after a while though...

@mrmonday mrmonday merged commit c10134b into libpnet:master Apr 8, 2022
@mrmonday
Copy link
Contributor

mrmonday commented Apr 8, 2022

Looks good, thanks!

@yu-re-ka yu-re-ka deleted the feature-fix-num-bytes branch April 8, 2022 15:33
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.

None yet

3 participants