mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix SO_ACCEPTCONN option for unix sockets.
SO_ACCEPTCONN returns true for TCP sockets which are in a listening state. Added this socket option support for unix sockets. PiperOrigin-RevId: 577008617
This commit is contained in:
committed by
gVisor bot
parent
b445e3ca8e
commit
aa02c6fa15
@@ -1076,13 +1076,8 @@ func getSockOptSocket(t *kernel.Task, s socket.Socket, ep commonEndpoint, family
|
||||
return nil, syserr.ErrInvalidArgument
|
||||
}
|
||||
|
||||
// This option is only viable for TCP endpoints.
|
||||
var v bool
|
||||
if socket.IsTCP(s) {
|
||||
v = tcp.EndpointState(ep.State()) == tcp.StateListen
|
||||
}
|
||||
vP := primitive.Int32(boolToInt32(v))
|
||||
return &vP, nil
|
||||
v := primitive.Int32(boolToInt32(ep.SocketOptions().GetAcceptConn()))
|
||||
return &v, nil
|
||||
|
||||
case linux.SO_RCVLOWAT:
|
||||
if outLen < sizeOfInt32 {
|
||||
|
||||
Reference in New Issue
Block a user