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/tcp | |
parent | 702553edddb87e4aa93a190840948539233f61fc (diff) | |
parent | 2e191cb3f72858c61943168a69b0aff0fda6ee45 (diff) |
Merge release-20201208.0-43-g2e191cb3f (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r-- | pkg/tcpip/transport/tcp/endpoint.go | 16 | ||||
-rw-r--r-- | pkg/tcpip/transport/tcp/tcp_state_autogen.go | 7 |
2 files changed, 4 insertions, 19 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go index 69512ebef..7a37c10bb 100644 --- a/pkg/tcpip/transport/tcp/endpoint.go +++ b/pkg/tcpip/transport/tcp/endpoint.go @@ -674,9 +674,6 @@ type endpoint struct { // owner is used to get uid and gid of the packet. owner tcpip.PacketOwner - // linger is used for SO_LINGER socket option. - linger tcpip.LingerOption - // ops is used to get socket level options. ops tcpip.SocketOptions } @@ -1040,7 +1037,8 @@ func (e *endpoint) Close() { return } - if e.linger.Enabled && e.linger.Timeout == 0 { + linger := e.SocketOptions().GetLinger() + if linger.Enabled && linger.Timeout == 0 { s := e.EndpointState() isResetState := s == StateEstablished || s == StateCloseWait || s == StateFinWait1 || s == StateFinWait2 || s == StateSynRecv if isResetState { @@ -1906,11 +1904,6 @@ func (e *endpoint) SetSockOpt(opt tcpip.SettableSocketOption) *tcpip.Error { case *tcpip.SocketDetachFilterOption: return nil - case *tcpip.LingerOption: - e.LockUser() - e.linger = *v - e.UnlockUser() - default: return nil } @@ -2071,11 +2064,6 @@ func (e *endpoint) GetSockOpt(opt tcpip.GettableSocketOption) *tcpip.Error { Port: port, } - case *tcpip.LingerOption: - e.LockUser() - *o = e.linger - e.UnlockUser() - default: return tcpip.ErrUnknownProtocolOption } diff --git a/pkg/tcpip/transport/tcp/tcp_state_autogen.go b/pkg/tcpip/transport/tcp/tcp_state_autogen.go index 71090ab61..8eba0efeb 100644 --- a/pkg/tcpip/transport/tcp/tcp_state_autogen.go +++ b/pkg/tcpip/transport/tcp/tcp_state_autogen.go @@ -217,7 +217,6 @@ func (e *endpoint) StateFields() []string { "closed", "txHash", "owner", - "linger", "ops", } } @@ -290,8 +289,7 @@ func (e *endpoint) StateSave(stateSinkObject state.Sink) { stateSinkObject.Save(58, &e.closed) stateSinkObject.Save(59, &e.txHash) stateSinkObject.Save(60, &e.owner) - stateSinkObject.Save(61, &e.linger) - stateSinkObject.Save(62, &e.ops) + stateSinkObject.Save(61, &e.ops) } func (e *endpoint) StateLoad(stateSourceObject state.Source) { @@ -351,8 +349,7 @@ func (e *endpoint) StateLoad(stateSourceObject state.Source) { stateSourceObject.Load(58, &e.closed) stateSourceObject.Load(59, &e.txHash) stateSourceObject.Load(60, &e.owner) - stateSourceObject.Load(61, &e.linger) - stateSourceObject.Load(62, &e.ops) + stateSourceObject.Load(61, &e.ops) stateSourceObject.LoadValue(4, new(string), func(y interface{}) { e.loadHardError(y.(string)) }) stateSourceObject.LoadValue(5, new(string), func(y interface{}) { e.loadLastError(y.(string)) }) stateSourceObject.LoadValue(13, new(EndpointState), func(y interface{}) { e.loadState(y.(EndpointState)) }) |