mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Silence the error log message for SO_RCVLOWAT option.
Removed the unimplemented syscall message for SO_RCVLOWAT option and added a
test for {g,s}etsockopt.
PiperOrigin-RevId: 438145815
This commit is contained in:
committed by
gVisor bot
parent
e40dd291c4
commit
007a91a911
@@ -1064,6 +1064,14 @@ func getSockOptSocket(t *kernel.Task, s socket.SocketOps, ep commonEndpoint, fam
|
||||
vP := primitive.Int32(boolToInt32(v))
|
||||
return &vP, nil
|
||||
|
||||
case linux.SO_RCVLOWAT:
|
||||
if outLen < sizeOfInt32 {
|
||||
return nil, syserr.ErrInvalidArgument
|
||||
}
|
||||
|
||||
v := primitive.Int32(ep.SocketOptions().GetRcvlowat())
|
||||
return &v, nil
|
||||
|
||||
default:
|
||||
socket.GetSockOptEmitUnimplementedEvent(t, name)
|
||||
}
|
||||
@@ -2002,6 +2010,17 @@ func setSockOptSocket(t *kernel.Task, s socket.SocketOps, ep commonEndpoint, nam
|
||||
var v tcpip.SocketDetachFilterOption
|
||||
return syserr.TranslateNetstackError(ep.SetSockOpt(&v))
|
||||
|
||||
// TODO(b/226603727): Add support for SO_RCVLOWAT option. For now, only
|
||||
// the unsupported syscall message is removed.
|
||||
case linux.SO_RCVLOWAT:
|
||||
if len(optVal) < sizeOfInt32 {
|
||||
return syserr.ErrInvalidArgument
|
||||
}
|
||||
|
||||
v := hostarch.ByteOrder.Uint32(optVal)
|
||||
ep.SocketOptions().SetRcvlowat(int32(v))
|
||||
return nil
|
||||
|
||||
default:
|
||||
socket.SetSockOptEmitUnimplementedEvent(t, name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user