diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-13 14:47:21 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-13 14:47:21 +0100 |
commit | 19a51132f5e952a7db8a9021348eae5ca144b77f (patch) | |
tree | 21785b4b94028ea5836e09376cd7f10d0710615d /Userland | |
parent | b59d588c0482a78c9a69f88b82aa0e2bb8fe1955 (diff) | |
download | serenity-19a51132f5e952a7db8a9021348eae5ca144b77f.zip |
Kernel: recvfrom() should treat the address arguments as outparams.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/ping.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/ping.cpp b/Userland/ping.cpp index 73ce7222b8..21ea2afc52 100644 --- a/Userland/ping.cpp +++ b/Userland/ping.cpp @@ -89,7 +89,8 @@ int main(int argc, char** argv) } for (;;) { - rc = recvfrom(fd, &pong_packet, sizeof(PingPacket), 0, (const struct sockaddr*)&peer_address, sizeof(sockaddr_in)); + socklen_t peer_address_size = sizeof(peer_address); + rc = recvfrom(fd, &pong_packet, sizeof(PingPacket), 0, (struct sockaddr*)&peer_address, &peer_address_size); if (rc < 0) { if (errno == EAGAIN) { printf("Request (seq=%u) timed out.\n", ntohs(ping_packet.header.un.echo.sequence)); |