summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/packet
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-11-13 07:00:09 +0000
committergVisor bot <gvisor-bot@google.com>2020-11-13 07:00:09 +0000
commitf560fd07ef27eef3027f03e93e2c958375d60dd7 (patch)
tree38c9c19a5948edaa06ab43454fb38a96d9f9531d /pkg/tcpip/transport/packet
parentf942d232b2c93d40a7af7007a8490c51d663e7f5 (diff)
parent5bb64ce1b8c42fcd96e44a5be05e17f34a83f840 (diff)
Merge release-20201030.0-83-g5bb64ce1b (automated)
Diffstat (limited to 'pkg/tcpip/transport/packet')
-rw-r--r--pkg/tcpip/transport/packet/endpoint.go7
-rw-r--r--pkg/tcpip/transport/packet/packet_state_autogen.go3
2 files changed, 10 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/packet/endpoint.go b/pkg/tcpip/transport/packet/endpoint.go
index 31831a6d8..3bff3755a 100644
--- a/pkg/tcpip/transport/packet/endpoint.go
+++ b/pkg/tcpip/transport/packet/endpoint.go
@@ -89,6 +89,9 @@ type endpoint struct {
// lastErrorMu protects lastError.
lastErrorMu sync.Mutex `state:"nosave"`
lastError *tcpip.Error `state:".(string)"`
+
+ // ops is used to get socket level options.
+ ops tcpip.SocketOptions
}
// NewEndpoint returns a new packet endpoint.
@@ -549,3 +552,7 @@ func (ep *endpoint) Stats() tcpip.EndpointStats {
}
func (ep *endpoint) SetOwner(owner tcpip.PacketOwner) {}
+
+func (ep *endpoint) SocketOptions() *tcpip.SocketOptions {
+ return &ep.ops
+}
diff --git a/pkg/tcpip/transport/packet/packet_state_autogen.go b/pkg/tcpip/transport/packet/packet_state_autogen.go
index 66b6a4cc2..2ce71eb84 100644
--- a/pkg/tcpip/transport/packet/packet_state_autogen.go
+++ b/pkg/tcpip/transport/packet/packet_state_autogen.go
@@ -64,6 +64,7 @@ func (ep *endpoint) StateFields() []string {
"boundNIC",
"linger",
"lastError",
+ "ops",
}
}
@@ -86,6 +87,7 @@ func (ep *endpoint) StateSave(stateSinkObject state.Sink) {
stateSinkObject.Save(11, &ep.bound)
stateSinkObject.Save(12, &ep.boundNIC)
stateSinkObject.Save(13, &ep.linger)
+ stateSinkObject.Save(15, &ep.ops)
}
func (ep *endpoint) StateLoad(stateSourceObject state.Source) {
@@ -102,6 +104,7 @@ func (ep *endpoint) StateLoad(stateSourceObject state.Source) {
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.AfterLoad(ep.afterLoad)