google / google/gvisor

IPv6 endpoint MaxHeaderLength doesn't consider extension headers

Open
#5,035 4 comments 0 reactions 0 assignees View on GitHub
area: networking revived type: cleanup
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

The common pattern to build frames at the transport layer is to allocate a buffer of sufficient size based on the response from `Route.MaxHeaderLength()`, which will in turn probe the `NetworkEndpoint` for its `MaxHeaderLength` implementation.

The IPv6 implementation currently lies about the maximum header length, adding only the minimum IPv6 header size to it, in order to prevent huge unused allocations.

Once `NetworkHeaderParams` introduces parameters that will be encoded as extension headers, upper layers will need a way to reserve the appropriate buffer space, which is likely dependent on the value of `NetworkHeaderParams`.

Perhaps `Route.MaxHeaderLength` should take `NetworkHeaderParams` as an argument.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.