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

packet_size may or may not include payload, depending on type #636

Open
mkeeter opened this issue Jul 22, 2023 · 0 comments
Open

packet_size may or may not include payload, depending on type #636

mkeeter opened this issue Jul 22, 2023 · 0 comments

Comments

@mkeeter
Copy link

mkeeter commented Jul 22, 2023

Calling packet_size on a UDP packet always returns 8, the header size. However, on an IPv6 packet, it returns a length that's inclusive of the payload. This is a surprising discrepancy!

I suspect this is because struct Ipv6 includes a #[length = "payload_length"] annotation, which is missing from struct Udp.

Would it make sense to add this annotation to struct Udp? If so, I'd be happy to open a PR.

Related: #169, #519; it's unclear which behavior is actually "correct" here.

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

1 participant