@@ -106,14 +106,6 @@ type connectionedEndpoint struct {
106106 // tcpip.SockStream.
107107 stype linux.SockType
108108
109- // peerCreds is used to store the peer credentials.
110- // This will store the socket's own credentials until the connection is
111- // established with connect(2). Once the connection is established, this
112- // will store the peer's credentials. The use of this option is possible
113- // only for connected `AF_UNIX` stream sockets and for `AF_UNIX` stream and
114- // datagram socket pairs created using socketpair(2)
115- peerCreds CredentialsControlMessage
116-
117109 // acceptedChan is per the TCP endpoint implementation. Note that the
118110 // sockets in this channel are _already in the connected state_, and
119111 // have another associated connectionedEndpoint.
@@ -282,16 +274,6 @@ func (e *connectionedEndpoint) Close(ctx context.Context) {
282274 }
283275}
284276
285- func (e * connectionedEndpoint ) swapPeerCreds (ctx context.Context , cend ConnectingEndpoint , ne * connectionedEndpoint ) * syserr.Error {
286- ce , ok := cend .(* connectionedEndpoint )
287- if ! ok {
288- return syserr .ErrInvalidEndpointState
289- }
290- // Swap peer credentials between the two endpoints.
291- ne .peerCreds , ce .peerCreds = ce .peerCreds , ne .peerCreds
292- return nil
293- }
294-
295277// BidirectionalConnect implements BoundEndpoint.BidirectionalConnect.
296278func (e * connectionedEndpoint ) BidirectionalConnect (ctx context.Context , ce ConnectingEndpoint , returnConnect func (Receiver , ConnectedEndpoint ), opts UnixSocketOpts ) * syserr.Error {
297279 if ce .Type () != e .stype {
@@ -345,7 +327,6 @@ func (e *connectionedEndpoint) BidirectionalConnect(ctx context.Context, ce Conn
345327 ne .ops .SetSendBufferSize (defaultBufferSize , false /* notify */ )
346328 ne .ops .SetReceiveBufferSize (defaultBufferSize , false /* notify */ )
347329 ne .SocketOptions ().SetPassCred (e .SocketOptions ().GetPassCred ())
348- ne .peerCreds = e .peerCreds
349330
350331 readQueue := & queue {ReaderQueue : ce .WaiterQueue (), WriterQueue : ne .Queue , limit : defaultBufferSize }
351332 readQueue .InitRefs ()
@@ -373,9 +354,6 @@ func (e *connectionedEndpoint) BidirectionalConnect(ctx context.Context, ce Conn
373354 }
374355 readQueue .IncRef ()
375356 if e .stype == linux .SOCK_STREAM {
376- if err := e .swapPeerCreds (ctx , ce , ne ); err != nil {
377- return err
378- }
379357 returnConnect (& streamQueueReceiver {queueReceiver : queueReceiver {readQueue : readQueue }}, connected )
380358 } else {
381359 returnConnect (& queueReceiver {readQueue : readQueue }, connected )
@@ -677,11 +655,3 @@ func (e *connectionedEndpoint) EventUnregister(we *waiter.Entry) {
677655func (e * connectionedEndpoint ) GetAcceptConn () bool {
678656 return e .Listening ()
679657}
680-
681- func (e * connectionedEndpoint ) PeerCreds () CredentialsControlMessage {
682- return e .peerCreds
683- }
684-
685- func (e * connectionedEndpoint ) SetPeerCreds (creds CredentialsControlMessage ) {
686- e .peerCreds = creds
687- }
0 commit comments