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

SimpleNetworks transmit passes too long buffer to SNP protocol. #1549

Closed
jas-nah opened this issue Feb 17, 2025 · 1 comment · Fixed by #1550
Closed

SimpleNetworks transmit passes too long buffer to SNP protocol. #1549

jas-nah opened this issue Feb 17, 2025 · 1 comment · Fixed by #1550

Comments

@jas-nah
Copy link

jas-nah commented Feb 17, 2025

In proto/network/snp.rs the transmit method passes the sum of the provided buffer length (buffer.len()) plus the specified header_size as BufferSize to the protocol. In my small test program I can send valid packets (e.g. ARP) but on the wire I can also see additional (random) bytes being transmitted after my buffer.

With my reading of the spec then Buffer passed to transmit should already contain bytes for both header and body, and header_size only indicates whether the protocol should manipulate the header before sending. With that I think the right value to pass on as BufferSize would actually be just buffer.len().

However, the spec is inconsistent as it talks about "placeing the packet specified by Header and Buffer on the transmit queue" but I don't see any other mention of Header anywhere (certainly it's not a paramter for transmit).

@nicholasbishop
Copy link
Member

I think you're correct, we should not be adding the header_size there. Thanks for reporting this, I'll put up a PR shortly.

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 a pull request may close this issue.

2 participants