Do not assume buffer.View boundaries for packet headers
Open
area: networking
revived
type: bug
- Dominant language
- Go
- Stars
- 19.3k
- Forks
- 2k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 264
Description
`stack.PacketBuffer.Data` is documented to be guaranteed not to contain headers that split across views. However, after a discussion with bhaskerh, this guarantee is not true. As such, we should remove all assumptions about `buffer.View` boundaries for packet headers.
```
// Data holds the payload of the packet. For inbound packets, it also
// holds the headers, which are consumed as the packet moves up the
// stack. Headers are guaranteed not to be split across views.
//
// The bytes backing Data are immutable, but Data itself may be trimmed
// or otherwise modified.
Data buffer.VectorisedView
```
Contributor guide
Assessment
This issue has not been assessed yet.