summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/packet
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-11-18 22:39:51 +0000
committergVisor bot <gvisor-bot@google.com>2020-11-18 22:39:51 +0000
commit0e43c0c8fb48ec92a81599b016d35a28e9e0f168 (patch)
treef150ad2d41e4eb59e4cead6f51bfd6327243a5c6 /pkg/tcpip/transport/packet
parent3cae5fbf49773ca2ec7b2ea5163899a3965ff504 (diff)
parentdf37babd576ba4607e2fe69eb2c669aa2954b9cb (diff)
Merge release-20201109.0-79-gdf37babd5 (automated)
Diffstat (limited to 'pkg/tcpip/transport/packet')
-rw-r--r--pkg/tcpip/transport/packet/endpoint.go3
-rw-r--r--pkg/tcpip/transport/packet/packet_state_autogen.go63
2 files changed, 36 insertions, 30 deletions
diff --git a/pkg/tcpip/transport/packet/endpoint.go b/pkg/tcpip/transport/packet/endpoint.go
index 3bff3755a..35d1be792 100644
--- a/pkg/tcpip/transport/packet/endpoint.go
+++ b/pkg/tcpip/transport/packet/endpoint.go
@@ -60,6 +60,8 @@ type packet struct {
// +stateify savable
type endpoint struct {
stack.TransportEndpointInfo
+ tcpip.DefaultSocketOptionsHandler
+
// The following fields are initialized at creation time and are
// immutable.
stack *stack.Stack `state:"manual"`
@@ -107,6 +109,7 @@ func NewEndpoint(s *stack.Stack, cooked bool, netProto tcpip.NetworkProtocolNumb
rcvBufSizeMax: 32 * 1024,
sndBufSize: 32 * 1024,
}
+ ep.ops.InitHandler(ep)
// Override with stack defaults.
var ss stack.SendBufferSizeOption
diff --git a/pkg/tcpip/transport/packet/packet_state_autogen.go b/pkg/tcpip/transport/packet/packet_state_autogen.go
index 2ce71eb84..42236056b 100644
--- a/pkg/tcpip/transport/packet/packet_state_autogen.go
+++ b/pkg/tcpip/transport/packet/packet_state_autogen.go
@@ -50,6 +50,7 @@ func (ep *endpoint) StateTypeName() string {
func (ep *endpoint) StateFields() []string {
return []string{
"TransportEndpointInfo",
+ "DefaultSocketOptionsHandler",
"netProto",
"waiterQueue",
"cooked",
@@ -71,42 +72,44 @@ func (ep *endpoint) StateFields() []string {
func (ep *endpoint) StateSave(stateSinkObject state.Sink) {
ep.beforeSave()
var rcvBufSizeMaxValue int = ep.saveRcvBufSizeMax()
- stateSinkObject.SaveValue(5, rcvBufSizeMaxValue)
+ stateSinkObject.SaveValue(6, rcvBufSizeMaxValue)
var lastErrorValue string = ep.saveLastError()
- stateSinkObject.SaveValue(14, lastErrorValue)
+ stateSinkObject.SaveValue(15, lastErrorValue)
stateSinkObject.Save(0, &ep.TransportEndpointInfo)
- stateSinkObject.Save(1, &ep.netProto)
- stateSinkObject.Save(2, &ep.waiterQueue)
- stateSinkObject.Save(3, &ep.cooked)
- stateSinkObject.Save(4, &ep.rcvList)
- stateSinkObject.Save(6, &ep.rcvBufSize)
- stateSinkObject.Save(7, &ep.rcvClosed)
- stateSinkObject.Save(8, &ep.sndBufSize)
- stateSinkObject.Save(9, &ep.sndBufSizeMax)
- stateSinkObject.Save(10, &ep.closed)
- stateSinkObject.Save(11, &ep.bound)
- stateSinkObject.Save(12, &ep.boundNIC)
- stateSinkObject.Save(13, &ep.linger)
- stateSinkObject.Save(15, &ep.ops)
+ stateSinkObject.Save(1, &ep.DefaultSocketOptionsHandler)
+ stateSinkObject.Save(2, &ep.netProto)
+ stateSinkObject.Save(3, &ep.waiterQueue)
+ stateSinkObject.Save(4, &ep.cooked)
+ stateSinkObject.Save(5, &ep.rcvList)
+ stateSinkObject.Save(7, &ep.rcvBufSize)
+ stateSinkObject.Save(8, &ep.rcvClosed)
+ stateSinkObject.Save(9, &ep.sndBufSize)
+ stateSinkObject.Save(10, &ep.sndBufSizeMax)
+ stateSinkObject.Save(11, &ep.closed)
+ stateSinkObject.Save(12, &ep.bound)
+ stateSinkObject.Save(13, &ep.boundNIC)
+ stateSinkObject.Save(14, &ep.linger)
+ stateSinkObject.Save(16, &ep.ops)
}
func (ep *endpoint) StateLoad(stateSourceObject state.Source) {
stateSourceObject.Load(0, &ep.TransportEndpointInfo)
- stateSourceObject.Load(1, &ep.netProto)
- stateSourceObject.Load(2, &ep.waiterQueue)
- stateSourceObject.Load(3, &ep.cooked)
- stateSourceObject.Load(4, &ep.rcvList)
- stateSourceObject.Load(6, &ep.rcvBufSize)
- stateSourceObject.Load(7, &ep.rcvClosed)
- stateSourceObject.Load(8, &ep.sndBufSize)
- stateSourceObject.Load(9, &ep.sndBufSizeMax)
- stateSourceObject.Load(10, &ep.closed)
- stateSourceObject.Load(11, &ep.bound)
- stateSourceObject.Load(12, &ep.boundNIC)
- stateSourceObject.Load(13, &ep.linger)
- stateSourceObject.Load(15, &ep.ops)
- stateSourceObject.LoadValue(5, new(int), func(y interface{}) { ep.loadRcvBufSizeMax(y.(int)) })
- stateSourceObject.LoadValue(14, new(string), func(y interface{}) { ep.loadLastError(y.(string)) })
+ stateSourceObject.Load(1, &ep.DefaultSocketOptionsHandler)
+ stateSourceObject.Load(2, &ep.netProto)
+ stateSourceObject.Load(3, &ep.waiterQueue)
+ stateSourceObject.Load(4, &ep.cooked)
+ stateSourceObject.Load(5, &ep.rcvList)
+ stateSourceObject.Load(7, &ep.rcvBufSize)
+ stateSourceObject.Load(8, &ep.rcvClosed)
+ stateSourceObject.Load(9, &ep.sndBufSize)
+ stateSourceObject.Load(10, &ep.sndBufSizeMax)
+ stateSourceObject.Load(11, &ep.closed)
+ stateSourceObject.Load(12, &ep.bound)
+ stateSourceObject.Load(13, &ep.boundNIC)
+ stateSourceObject.Load(14, &ep.linger)
+ stateSourceObject.Load(16, &ep.ops)
+ stateSourceObject.LoadValue(6, new(int), func(y interface{}) { ep.loadRcvBufSizeMax(y.(int)) })
+ stateSourceObject.LoadValue(15, new(string), func(y interface{}) { ep.loadLastError(y.(string)) })
stateSourceObject.AfterLoad(ep.afterLoad)
}