diff options
author | Kevin Krakauer <krakauer@google.com> | 2020-04-13 17:37:21 -0700 |
---|---|---|
committer | Kevin Krakauer <krakauer@google.com> | 2020-04-17 13:25:57 -0700 |
commit | a551add5d8a5bf631cd9859c761e579fdb33ec82 (patch) | |
tree | 44563f8173fe203da367d47bf3aca633dbbba76c /pkg/tcpip/stack/packet_buffer.go | |
parent | 80deebb0bfde2a53c943deb8d8473239bb6de3eb (diff) |
Remove View.First() and View.RemoveFirst()
These methods let users eaily break the VectorisedView abstraction, and
allowed netstack to slip into pseudo-enforcement of the "all headers are
in the first View" invariant. Removing them and replacing with PullUp(n)
breaks this reliance and will make it easier to add iptables support and
rework network buffer management.
The new View.PullUp(n) method is low cost in the common case, when when
all the headers fit in the first View.
Diffstat (limited to 'pkg/tcpip/stack/packet_buffer.go')
-rw-r--r-- | pkg/tcpip/stack/packet_buffer.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/packet_buffer.go b/pkg/tcpip/stack/packet_buffer.go index dc125f25e..e954a8b7e 100644 --- a/pkg/tcpip/stack/packet_buffer.go +++ b/pkg/tcpip/stack/packet_buffer.go @@ -37,7 +37,9 @@ type PacketBuffer struct { Data buffer.VectorisedView // Header holds the headers of outbound packets. As a packet is passed - // down the stack, each layer adds to Header. + // down the stack, each layer adds to Header. Note that forwarded + // packets don't populate Headers on their way out -- their headers and + // payload are never parsed out and remain in Data. Header buffer.Prependable // These fields are used by both inbound and outbound packets. They |