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

CaptureFileWriterDevice.Write((RawCapture p) ignores PacketLength field #479

Open
alikovvl opened this issue Oct 27, 2023 · 4 comments
Open

Comments

@alikovvl
Copy link

If the data buffer is larger than the packet, it will be completely saved in a pcap file. This results in a large pcap file and makes it difficult to analyze. Such buffers are obtained by using ArrayPool.Rent.

@kayoub5
Copy link
Collaborator

kayoub5 commented Oct 27, 2023

got an example?

@alikovvl
Copy link
Author

public void Write(RawCapture p)

This will happen if the buffer size is not equal to the packet size.

@kayoub5
Copy link
Collaborator

kayoub5 commented Oct 30, 2023

you need to create Span<byte> with correct size from the array you rented.

@alikovvl
Copy link
Author

Sharppcap.Issue479.zip

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

No branches or pull requests

2 participants