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
Issue 487 #557
base: main
Are you sure you want to change the base?
Issue 487 #557
Conversation
changed benches to criterion so to stay on stable toolchain, added inlining so that parsing is faster
…e payload is at the end of the packet, github issue libpnet#487
only approve the last workflow, please. i had commented some code in master that i shouldnt have when i renamed master to main. Rust 112 passes on branch: https://github.com/infosechoudini/libpnet/actions/runs/2208929740 |
Fragment IPv6 Payload Error
It looks like the PR now has conflicts with the master branch. |
resolved the conflicts |
this can be merged now |
pull_request: | ||
branches: [ master ] |
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.
Please revert this,libpnet
still uses master
.
I'm happy to change this, but it should be separate from this PR.
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.
please change this
@@ -0,0 +1,20 @@ | |||
--- |
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.
Nice, thanks for adding these!
accessors = accessors, | ||
name = field.name, | ||
ty_str = ty_str, | ||
ctor = ctor |
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.
I assume all these whitespace changes are from rustfmt
?
@@ -1012,7 +1021,7 @@ fn handle_vec_primitive( | |||
#[allow(trivial_numeric_casts, unused_parens, unused_braces)] | |||
#[cfg_attr(feature = \"clippy\", allow(used_underscore_binding))] | |||
pub fn get_{name}(&self) -> Vec<{inner_ty_str}> {{ | |||
use core::cmp::min; |
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.
Is there a reason for this change?
I believe this will break libpnet when compiled without the std
feature?
{inner_ty_str}Iterable {{ | ||
buf: &_self.packet[current_offset..end] | ||
}}.map(|packet| packet.from_packet()) | ||
.collect::<Vec<_>>() | ||
.collect::<Vec<_>>() |
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.
Stray trailing whitespace here.
@@ -1321,7 +1330,7 @@ fn handle_vector_field( | |||
let _self = self; | |||
let current_offset = {co}; | |||
let end = min(current_offset + {packet_length}, _self.packet.len()); | |||
|
|||
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.
And here.
@@ -383,6 +383,7 @@ fn ipv4_packet_option_test() { | |||
0x03, /* length */ | |||
0x10, /* data */]; | |||
|
|||
println!("{:?}", packet); |
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.
I think this was left in by mistake?
|
||
|
||
#[test] | ||
fn main() { |
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.
Does this get picked up when running cargo test
?
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.
yes
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.
AFAIK
#[length=0]
for payload so that users can assign payload to the FragmentPacket#[length]
isn't needed#[inline]
for speedpnet/src/gh_issue_487.rs