|
@@ -135,7 +135,7 @@ KResult IPv4Socket::bind(Userspace<const sockaddr*> user_address, socklen_t addr
|
|
|
|
|
|
KResult IPv4Socket::listen(size_t backlog)
|
|
|
{
|
|
|
- MutexLocker locker(lock());
|
|
|
+ MutexLocker locker(mutex());
|
|
|
auto result = allocate_local_port_if_needed();
|
|
|
if (result.error_or_port.is_error() && result.error_or_port.error() != ENOPROTOOPT)
|
|
|
return result.error_or_port.error();
|
|
@@ -190,7 +190,7 @@ bool IPv4Socket::can_write(const FileDescription&, size_t) const
|
|
|
|
|
|
PortAllocationResult IPv4Socket::allocate_local_port_if_needed()
|
|
|
{
|
|
|
- MutexLocker locker(lock());
|
|
|
+ MutexLocker locker(mutex());
|
|
|
if (m_local_port)
|
|
|
return { m_local_port, false };
|
|
|
auto port_or_error = protocol_allocate_local_port();
|
|
@@ -202,7 +202,7 @@ PortAllocationResult IPv4Socket::allocate_local_port_if_needed()
|
|
|
|
|
|
KResultOr<size_t> IPv4Socket::sendto(FileDescription&, const UserOrKernelBuffer& data, size_t data_length, [[maybe_unused]] int flags, Userspace<const sockaddr*> addr, socklen_t addr_length)
|
|
|
{
|
|
|
- MutexLocker locker(lock());
|
|
|
+ MutexLocker locker(mutex());
|
|
|
|
|
|
if (addr && addr_length != sizeof(sockaddr_in))
|
|
|
return set_so_error(EINVAL);
|
|
@@ -261,7 +261,7 @@ KResultOr<size_t> IPv4Socket::sendto(FileDescription&, const UserOrKernelBuffer&
|
|
|
|
|
|
KResultOr<size_t> IPv4Socket::receive_byte_buffered(FileDescription& description, UserOrKernelBuffer& buffer, size_t buffer_length, int flags, Userspace<sockaddr*>, Userspace<socklen_t*>)
|
|
|
{
|
|
|
- MutexLocker locker(lock());
|
|
|
+ MutexLocker locker(mutex());
|
|
|
if (m_receive_buffer->is_empty()) {
|
|
|
if (protocol_is_disconnected())
|
|
|
return 0;
|
|
@@ -297,7 +297,7 @@ KResultOr<size_t> IPv4Socket::receive_byte_buffered(FileDescription& description
|
|
|
|
|
|
KResultOr<size_t> IPv4Socket::receive_packet_buffered(FileDescription& description, UserOrKernelBuffer& buffer, size_t buffer_length, int flags, Userspace<sockaddr*> addr, Userspace<socklen_t*> addr_length, Time& packet_timestamp)
|
|
|
{
|
|
|
- MutexLocker locker(lock());
|
|
|
+ MutexLocker locker(mutex());
|
|
|
ReceivedPacket packet;
|
|
|
{
|
|
|
if (m_receive_queue.is_empty()) {
|
|
@@ -412,7 +412,7 @@ KResultOr<size_t> IPv4Socket::recvfrom(FileDescription& description, UserOrKerne
|
|
|
|
|
|
bool IPv4Socket::did_receive(const IPv4Address& source_address, u16 source_port, ReadonlyBytes packet, const Time& packet_timestamp)
|
|
|
{
|
|
|
- MutexLocker locker(lock());
|
|
|
+ MutexLocker locker(mutex());
|
|
|
|
|
|
if (is_shut_down_for_reading())
|
|
|
return false;
|