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

[bugfix] Fix handling of mock snaplen field in pktHdr for packets smaller than snaplen #85

Merged

Conversation

fako1024
Copy link
Owner

@fako1024 fako1024 commented May 6, 2024

Closes #84

@fako1024 fako1024 added the bug Something isn't working label May 6, 2024
@fako1024 fako1024 requested a review from els0r May 6, 2024 13:17
@fako1024 fako1024 self-assigned this May 6, 2024
@fako1024 fako1024 linked an issue May 6, 2024 that may be closed by this pull request
@@ -76,7 +76,7 @@ finalize:
pos := pktHdr.ppos + uint32(hdr.pktMac)

// Return the payload / IP layer subslice & heeader parameters
return unsafe.Slice(&pktHdr.data[pos], hdr.snaplen),
return unsafe.Slice(&pktHdr.data[pos], hdr.snaplen), // #nosec: G103
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by Linter fix...

@fako1024 fako1024 changed the title [bugfix] Fix handling of snaplen field in pktHdr for packets smaller than snaplen [bugfix] Fix handling of mock snaplen field in pktHdr for packets smaller than snaplen May 6, 2024
@fako1024 fako1024 merged commit 556f20f into main May 6, 2024
4 checks passed
@fako1024 fako1024 deleted the 84-align-mock-snaplen-handling-for-pkthdr-with-reality branch May 6, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align mock snaplen handling for pktHdr with reality
2 participants