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

Replace payload_len with total_len in Ipv4Header #48

Closed
JulianSchmid opened this issue Dec 31, 2022 · 1 comment
Closed

Replace payload_len with total_len in Ipv4Header #48

JulianSchmid opened this issue Dec 31, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@JulianSchmid
Copy link
Owner

The current implementation of the Ipv4Header has the field payload_length that does not exist in the real IPv4 header. The real IPv4 header has a field total_length that also contains the length of the header itself, while payload_length only describes the length of the payload of the IPv4 packet.

This sometimes leads to confusion what was actually present on the wire & also leads to some not-so-nice corner cases that can trigger error return values when writing & decoding headers (e.g. when the payload_len + header_len is bigger then u16::MAX).

Replace payload_len with total_len so the header mirrors the data of the actual on the wire header.

@JulianSchmid JulianSchmid added the enhancement New feature or request label Jan 4, 2023
@JulianSchmid JulianSchmid added this to the v0.14 milestone Apr 12, 2023
@JulianSchmid JulianSchmid self-assigned this Apr 12, 2023
@JulianSchmid
Copy link
Owner Author

Done with #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant