diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-03-26 22:49:28 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-26 22:49:28 +0000 |
commit | 9699018b4ab2b2ca9abb3170abff4ab630238641 (patch) | |
tree | ccc43fb184215226265ede5412a2ed3ca6bed433 /pkg/tcpip/stack | |
parent | 98c58a207c4b3dfc9dd9b0d0ccab4e85fe82be75 (diff) | |
parent | 0e62a548eb093c95e41780c753afa87f4ccc5c8f (diff) |
Merge release-20200219.0-249-g0e62a54 (automated)
Diffstat (limited to 'pkg/tcpip/stack')
-rwxr-xr-x | pkg/tcpip/stack/packet_buffer.go | 9 | ||||
-rwxr-xr-x | pkg/tcpip/stack/stack_state_autogen.go | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/packet_buffer.go b/pkg/tcpip/stack/packet_buffer.go index 9505a4e92..9367de180 100755 --- a/pkg/tcpip/stack/packet_buffer.go +++ b/pkg/tcpip/stack/packet_buffer.go @@ -13,7 +13,10 @@ package stack -import "gvisor.dev/gvisor/pkg/tcpip/buffer" +import ( + "gvisor.dev/gvisor/pkg/tcpip" + "gvisor.dev/gvisor/pkg/tcpip/buffer" +) // A PacketBuffer contains all the data of a network packet. // @@ -59,6 +62,10 @@ type PacketBuffer struct { // Hash is the transport layer hash of this packet. A value of zero // indicates no valid hash has been set. Hash uint32 + + // Owner is implemented by task to get the uid and gid. + // Only set for locally generated packets. + Owner tcpip.PacketOwner } // Clone makes a copy of pk. It clones the Data field, which creates a new diff --git a/pkg/tcpip/stack/stack_state_autogen.go b/pkg/tcpip/stack/stack_state_autogen.go index 61c3fdec2..7f038a856 100755 --- a/pkg/tcpip/stack/stack_state_autogen.go +++ b/pkg/tcpip/stack/stack_state_autogen.go @@ -42,6 +42,7 @@ func (x *PacketBuffer) save(m state.Map) { m.Save("NetworkHeader", &x.NetworkHeader) m.Save("TransportHeader", &x.TransportHeader) m.Save("Hash", &x.Hash) + m.Save("Owner", &x.Owner) } func (x *PacketBuffer) afterLoad() {} @@ -54,6 +55,7 @@ func (x *PacketBuffer) load(m state.Map) { m.Load("NetworkHeader", &x.NetworkHeader) m.Load("TransportHeader", &x.TransportHeader) m.Load("Hash", &x.Hash) + m.Load("Owner", &x.Owner) } func (x *TransportEndpointID) beforeSave() {} |