From fc342fb43960e5f75103e727cd122479e015d321 Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Wed, 18 Nov 2020 10:15:36 -0800 Subject: [netstack] Move SO_PASSCRED option to SocketOptions. This change also makes the following fixes: - Make SocketOptions use atomic operations instead of having to acquire/drop locks upon each get/set option. - Make documentation more consistent. - Remove tcpip.SocketOptions from socketOpsCommon because it already exists in transport.Endpoint. - Refactors get/set socket options tests to be easily extendable. PiperOrigin-RevId: 343103780 --- pkg/tcpip/transport/tcp/endpoint.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/tcpip/transport/tcp') diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go index 173cd28ec..36b915510 100644 --- a/pkg/tcpip/transport/tcp/endpoint.go +++ b/pkg/tcpip/transport/tcp/endpoint.go @@ -1279,6 +1279,7 @@ func (e *endpoint) ModerateRecvBuf(copied int) { e.rcvListMu.Unlock() } +// SetOwner implements tcpip.Endpoint.SetOwner. func (e *endpoint) SetOwner(owner tcpip.PacketOwner) { e.owner = owner } @@ -1299,6 +1300,7 @@ func (e *endpoint) lastErrorLocked() *tcpip.Error { return err } +// LastError implements tcpip.Endpoint.LastError. func (e *endpoint) LastError() *tcpip.Error { e.LockUser() defer e.UnlockUser() @@ -3213,6 +3215,7 @@ func (e *endpoint) Wait() { } } +// SocketOptions implements tcpip.Endpoint.SocketOptions. func (e *endpoint) SocketOptions() *tcpip.SocketOptions { return &e.ops } -- cgit v1.2.3