Improve the header.IPv6 API
- Dominant language
- Go
- Stars
- 19.3k
- Forks
- 2k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 264
Description
**Description**
The IPv6 Header api follows the wording of RFC 8200: the extension headers are considered payload, and the payload length takes into account the extension headers.
It might make sense to change the API to consider that a payload is strictly the upper-layer payload.
**Do you have a specific solution in mind?**
We could change the API so that
Payload() -> only returns the upper-layer payload
PayloadLength() -> only returns the length of the upper-layer payload
Then add functions to expose information about the extension headers
ExtensionHeaders() -> returns the extension headers only
ExtensionHeadersLength() -> returns the extension headers length
And probably some way to return both payloads at once
Note: we need to parse the extension header to find out the length of the payloads, so it might be a good idea to store the lengths in separate fields - however header.IPv6 is written directly into the packet buffers so we can't store extra data in it. Maybe create a new type that wraps header.IPv6 and adds the new meta data next to it.
Contributor guide
Assessment
This issue has not been assessed yet.