sys/net/ipv4: fix internet header length - #22552
Conversation
888ef24 to
d461720
Compare
affc32e to
f7f740e
Compare
| * * ipv4_hdr_get_ihl() | ||
| */ | ||
| uint8_t v_ih; | ||
| uint8_t v_ihl; |
There was a problem hiding this comment.
I still wonder if that counts as an API change. Although this is part of the internal struct and there are setters and getters that should be used.
There was a problem hiding this comment.
The existing getters and setters are incorrect, and there are no uses of v_ih and/or any of the ipv4_hdr_{get/set}_* within RIOT. Furthermore, the header fields already mention the use of the getters and setters.
With that in mind, I think this change is acceptable.
|
Ideally I'd like to get feedback from @jia200x too before merging, but if he doesn't respond (also pinged him on Matrix), this is minor enough to merge just like that I guess. |
|
That is fine. If I can do an intermediate squash already, that would be nice. Then I will continue with next PRs to get GNRC IPv4 ready based on this one :-) |
|
Sure! |
The internet header length occupies the four least significant bits, of the combined version-internet header length field. Its value ( multiplied by four) indicates the length of the IPv4 header.
67876d1 to
58cdedb
Compare
Contribution description
The internet header length field is incorrectly stored in the
v_ihlfield. According to the documentation, it expects bytes as input.Also renamed
v_ihtov_ihlto be consistent, and added unit tests for this header.Testing procedure
Run the unit tests:
make -C tests/unittests tests-ipv4_hdr termIssues/PRs references
I want to give
gnrc_ipv4(#12988) another go, so I started with the obvious things.Declaration of AI-Tools / LLMs usage:
AI-Tools / LLMs that were used are: