diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-12-14 20:11:32 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-12-14 20:11:32 +0000 |
commit | 22ae84e87a245ca815d04548b1f3ca6ae5f07af2 (patch) | |
tree | 77e7ba1afc34cb67cbf2ab3ed11ab9f612111bb5 /pkg/tcpip/transport/packet | |
parent | 702553edddb87e4aa93a190840948539233f61fc (diff) | |
parent | 2e191cb3f72858c61943168a69b0aff0fda6ee45 (diff) |
Merge release-20201208.0-43-g2e191cb3f (automated)
Diffstat (limited to 'pkg/tcpip/transport/packet')
-rw-r--r-- | pkg/tcpip/transport/packet/endpoint.go | 21 | ||||
-rw-r--r-- | pkg/tcpip/transport/packet/packet_state_autogen.go | 11 |
2 files changed, 6 insertions, 26 deletions
diff --git a/pkg/tcpip/transport/packet/endpoint.go b/pkg/tcpip/transport/packet/endpoint.go index 1e7debbb4..9faab4b9e 100644 --- a/pkg/tcpip/transport/packet/endpoint.go +++ b/pkg/tcpip/transport/packet/endpoint.go @@ -85,8 +85,6 @@ type endpoint struct { stats tcpip.TransportEndpointStats `state:"nosave"` bound bool boundNIC tcpip.NICID - // linger is used for SO_LINGER socket option. - linger tcpip.LingerOption // lastErrorMu protects lastError. lastErrorMu sync.Mutex `state:"nosave"` @@ -306,16 +304,10 @@ func (ep *endpoint) Readiness(mask waiter.EventMask) waiter.EventMask { // used with SetSockOpt, and this function always returns // tcpip.ErrNotSupported. func (ep *endpoint) SetSockOpt(opt tcpip.SettableSocketOption) *tcpip.Error { - switch v := opt.(type) { + switch opt.(type) { case *tcpip.SocketDetachFilterOption: return nil - case *tcpip.LingerOption: - ep.mu.Lock() - ep.linger = *v - ep.mu.Unlock() - return nil - default: return tcpip.ErrUnknownProtocolOption } @@ -376,16 +368,7 @@ func (ep *endpoint) LastError() *tcpip.Error { // GetSockOpt implements tcpip.Endpoint.GetSockOpt. func (ep *endpoint) GetSockOpt(opt tcpip.GettableSocketOption) *tcpip.Error { - switch o := opt.(type) { - case *tcpip.LingerOption: - ep.mu.Lock() - *o = ep.linger - ep.mu.Unlock() - return nil - - default: - return tcpip.ErrNotSupported - } + return tcpip.ErrNotSupported } // GetSockOptInt implements tcpip.Endpoint.GetSockOptInt. diff --git a/pkg/tcpip/transport/packet/packet_state_autogen.go b/pkg/tcpip/transport/packet/packet_state_autogen.go index 42236056b..ccb66800b 100644 --- a/pkg/tcpip/transport/packet/packet_state_autogen.go +++ b/pkg/tcpip/transport/packet/packet_state_autogen.go @@ -63,7 +63,6 @@ func (ep *endpoint) StateFields() []string { "closed", "bound", "boundNIC", - "linger", "lastError", "ops", } @@ -74,7 +73,7 @@ func (ep *endpoint) StateSave(stateSinkObject state.Sink) { var rcvBufSizeMaxValue int = ep.saveRcvBufSizeMax() stateSinkObject.SaveValue(6, rcvBufSizeMaxValue) var lastErrorValue string = ep.saveLastError() - stateSinkObject.SaveValue(15, lastErrorValue) + stateSinkObject.SaveValue(14, lastErrorValue) stateSinkObject.Save(0, &ep.TransportEndpointInfo) stateSinkObject.Save(1, &ep.DefaultSocketOptionsHandler) stateSinkObject.Save(2, &ep.netProto) @@ -88,8 +87,7 @@ func (ep *endpoint) StateSave(stateSinkObject state.Sink) { 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) + stateSinkObject.Save(15, &ep.ops) } func (ep *endpoint) StateLoad(stateSourceObject state.Source) { @@ -106,10 +104,9 @@ func (ep *endpoint) StateLoad(stateSourceObject state.Source) { 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.Load(15, &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.LoadValue(14, new(string), func(y interface{}) { ep.loadLastError(y.(string)) }) stateSourceObject.AfterLoad(ep.afterLoad) } |