From 22c6783db20487257c9fb7ec9a983d1cf5d95afb Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 8 Feb 2021 19:26:11 +0100 Subject: [PATCH] ping: Replace two magic numbers with ICMP_* macros --- Userland/Utilities/ping.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Utilities/ping.cpp b/Userland/Utilities/ping.cpp index ab398f42d9..cec2b88fbb 100644 --- a/Userland/Utilities/ping.cpp +++ b/Userland/Utilities/ping.cpp @@ -157,7 +157,7 @@ int main(int argc, char** argv) PingPacket ping_packet; memset(&ping_packet, 0, sizeof(PingPacket)); - ping_packet.header.type = 8; // Echo request + ping_packet.header.type = ICMP_ECHO; ping_packet.header.code = 0; ping_packet.header.un.echo.id = htons(pid); ping_packet.header.un.echo.sequence = htons(seq++); @@ -192,7 +192,7 @@ int main(int argc, char** argv) return 1; } - if (pong_packet.header.type != 0) + if (pong_packet.header.type != ICMP_ECHOREPLY) continue; if (pong_packet.header.code != 0) continue;