1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

Kernel: Make accept() fill address with peer name rather than local name

This commit is contained in:
Conrad Pankoff 2019-08-10 12:25:30 +10:00 committed by Andreas Kling
parent 5c0f1f9834
commit 5308e310a0

View file

@ -2167,7 +2167,7 @@ int Process::sys$accept(int accepting_socket_fd, sockaddr* address, socklen_t* a
}
auto accepted_socket = socket.accept();
ASSERT(accepted_socket);
bool success = accepted_socket->get_local_address(address, address_size);
bool success = accepted_socket->get_peer_address(address, address_size);
ASSERT(success);
auto accepted_socket_description = FileDescription::create(move(accepted_socket), SocketRole::Accepted);
// NOTE: The accepted socket inherits fd flags from the accepting socket.