diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-10-20 22:57:59 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-20 22:57:59 +0000 |
commit | bde845de1628ae718e6b1c5e1ffd29667fe71356 (patch) | |
tree | 3283aeb81745b3fcf02b4d4ca0c7692ddcd43978 | |
parent | 04858e0bccc0242ca505aeec23e13954a0d2a96d (diff) | |
parent | 4da10f873e22a43be648ab34c9b9b2759d33337d (diff) |
Merge release-20201005.0-112-g4da10f873 (automated)
-rw-r--r-- | pkg/tcpip/transport/raw/endpoint_state.go | 38 | ||||
-rw-r--r-- | pkg/tcpip/transport/raw/raw_state_autogen.go | 76 |
2 files changed, 57 insertions, 57 deletions
diff --git a/pkg/tcpip/transport/raw/endpoint_state.go b/pkg/tcpip/transport/raw/endpoint_state.go index 33bfb56cd..7d97cbdc7 100644 --- a/pkg/tcpip/transport/raw/endpoint_state.go +++ b/pkg/tcpip/transport/raw/endpoint_state.go @@ -37,57 +37,57 @@ func (p *rawPacket) loadData(data buffer.VectorisedView) { } // beforeSave is invoked by stateify. -func (ep *endpoint) beforeSave() { +func (e *endpoint) beforeSave() { // Stop incoming packets from being handled (and mutate endpoint state). // The lock will be released after saveRcvBufSizeMax(), which would have - // saved ep.rcvBufSizeMax and set it to 0 to continue blocking incoming + // saved e.rcvBufSizeMax and set it to 0 to continue blocking incoming // packets. - ep.rcvMu.Lock() + e.rcvMu.Lock() } // saveRcvBufSizeMax is invoked by stateify. -func (ep *endpoint) saveRcvBufSizeMax() int { - max := ep.rcvBufSizeMax +func (e *endpoint) saveRcvBufSizeMax() int { + max := e.rcvBufSizeMax // Make sure no new packets will be handled regardless of the lock. - ep.rcvBufSizeMax = 0 + e.rcvBufSizeMax = 0 // Release the lock acquired in beforeSave() so regular endpoint closing // logic can proceed after save. - ep.rcvMu.Unlock() + e.rcvMu.Unlock() return max } // loadRcvBufSizeMax is invoked by stateify. -func (ep *endpoint) loadRcvBufSizeMax(max int) { - ep.rcvBufSizeMax = max +func (e *endpoint) loadRcvBufSizeMax(max int) { + e.rcvBufSizeMax = max } // afterLoad is invoked by stateify. -func (ep *endpoint) afterLoad() { - stack.StackFromEnv.RegisterRestoredEndpoint(ep) +func (e *endpoint) afterLoad() { + stack.StackFromEnv.RegisterRestoredEndpoint(e) } // Resume implements tcpip.ResumableEndpoint.Resume. -func (ep *endpoint) Resume(s *stack.Stack) { - ep.stack = s +func (e *endpoint) Resume(s *stack.Stack) { + e.stack = s // If the endpoint is connected, re-connect. - if ep.connected { + if e.connected { var err *tcpip.Error - ep.route, err = ep.stack.FindRoute(ep.RegisterNICID, ep.BindAddr, ep.route.RemoteAddress, ep.NetProto, false) + e.route, err = e.stack.FindRoute(e.RegisterNICID, e.BindAddr, e.route.RemoteAddress, e.NetProto, false) if err != nil { panic(err) } } // If the endpoint is bound, re-bind. - if ep.bound { - if ep.stack.CheckLocalAddress(ep.RegisterNICID, ep.NetProto, ep.BindAddr) == 0 { + if e.bound { + if e.stack.CheckLocalAddress(e.RegisterNICID, e.NetProto, e.BindAddr) == 0 { panic(tcpip.ErrBadLocalAddress) } } - if ep.associated { - if err := ep.stack.RegisterRawTransportEndpoint(ep.RegisterNICID, ep.NetProto, ep.TransProto, ep); err != nil { + if e.associated { + if err := e.stack.RegisterRawTransportEndpoint(e.RegisterNICID, e.NetProto, e.TransProto, e); err != nil { panic(err) } } diff --git a/pkg/tcpip/transport/raw/raw_state_autogen.go b/pkg/tcpip/transport/raw/raw_state_autogen.go index ae59d31d6..7a5831bf3 100644 --- a/pkg/tcpip/transport/raw/raw_state_autogen.go +++ b/pkg/tcpip/transport/raw/raw_state_autogen.go @@ -40,11 +40,11 @@ func (p *rawPacket) StateLoad(stateSourceObject state.Source) { stateSourceObject.LoadValue(1, new(buffer.VectorisedView), func(y interface{}) { p.loadData(y.(buffer.VectorisedView)) }) } -func (ep *endpoint) StateTypeName() string { +func (e *endpoint) StateTypeName() string { return "pkg/tcpip/transport/raw.endpoint" } -func (ep *endpoint) StateFields() []string { +func (e *endpoint) StateFields() []string { return []string{ "TransportEndpointInfo", "waiterQueue", @@ -64,43 +64,43 @@ func (ep *endpoint) StateFields() []string { } } -func (ep *endpoint) StateSave(stateSinkObject state.Sink) { - ep.beforeSave() - var rcvBufSizeMaxValue int = ep.saveRcvBufSizeMax() +func (e *endpoint) StateSave(stateSinkObject state.Sink) { + e.beforeSave() + var rcvBufSizeMaxValue int = e.saveRcvBufSizeMax() stateSinkObject.SaveValue(6, rcvBufSizeMaxValue) - stateSinkObject.Save(0, &ep.TransportEndpointInfo) - stateSinkObject.Save(1, &ep.waiterQueue) - stateSinkObject.Save(2, &ep.associated) - stateSinkObject.Save(3, &ep.hdrIncluded) - stateSinkObject.Save(4, &ep.rcvList) - stateSinkObject.Save(5, &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.connected) - stateSinkObject.Save(12, &ep.bound) - stateSinkObject.Save(13, &ep.linger) - stateSinkObject.Save(14, &ep.owner) -} - -func (ep *endpoint) StateLoad(stateSourceObject state.Source) { - stateSourceObject.Load(0, &ep.TransportEndpointInfo) - stateSourceObject.Load(1, &ep.waiterQueue) - stateSourceObject.Load(2, &ep.associated) - stateSourceObject.Load(3, &ep.hdrIncluded) - stateSourceObject.Load(4, &ep.rcvList) - stateSourceObject.Load(5, &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.connected) - stateSourceObject.Load(12, &ep.bound) - stateSourceObject.Load(13, &ep.linger) - stateSourceObject.Load(14, &ep.owner) - stateSourceObject.LoadValue(6, new(int), func(y interface{}) { ep.loadRcvBufSizeMax(y.(int)) }) - stateSourceObject.AfterLoad(ep.afterLoad) + stateSinkObject.Save(0, &e.TransportEndpointInfo) + stateSinkObject.Save(1, &e.waiterQueue) + stateSinkObject.Save(2, &e.associated) + stateSinkObject.Save(3, &e.hdrIncluded) + stateSinkObject.Save(4, &e.rcvList) + stateSinkObject.Save(5, &e.rcvBufSize) + stateSinkObject.Save(7, &e.rcvClosed) + stateSinkObject.Save(8, &e.sndBufSize) + stateSinkObject.Save(9, &e.sndBufSizeMax) + stateSinkObject.Save(10, &e.closed) + stateSinkObject.Save(11, &e.connected) + stateSinkObject.Save(12, &e.bound) + stateSinkObject.Save(13, &e.linger) + stateSinkObject.Save(14, &e.owner) +} + +func (e *endpoint) StateLoad(stateSourceObject state.Source) { + stateSourceObject.Load(0, &e.TransportEndpointInfo) + stateSourceObject.Load(1, &e.waiterQueue) + stateSourceObject.Load(2, &e.associated) + stateSourceObject.Load(3, &e.hdrIncluded) + stateSourceObject.Load(4, &e.rcvList) + stateSourceObject.Load(5, &e.rcvBufSize) + stateSourceObject.Load(7, &e.rcvClosed) + stateSourceObject.Load(8, &e.sndBufSize) + stateSourceObject.Load(9, &e.sndBufSizeMax) + stateSourceObject.Load(10, &e.closed) + stateSourceObject.Load(11, &e.connected) + stateSourceObject.Load(12, &e.bound) + stateSourceObject.Load(13, &e.linger) + stateSourceObject.Load(14, &e.owner) + stateSourceObject.LoadValue(6, new(int), func(y interface{}) { e.loadRcvBufSizeMax(y.(int)) }) + stateSourceObject.AfterLoad(e.afterLoad) } func (l *rawPacketList) StateTypeName() string { |