diff options
author | Linus Groh <mail@linusgroh.de> | 2021-02-08 19:26:11 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-08 20:00:08 +0100 |
commit | 22c6783db20487257c9fb7ec9a983d1cf5d95afb (patch) | |
tree | f12aebb2e9fef2566077d845a72452da3f34fa74 | |
parent | 2b03e95354efde6d3a04702cc77f5af96e1f996a (diff) | |
download | serenity-22c6783db20487257c9fb7ec9a983d1cf5d95afb.zip |
ping: Replace two magic numbers with ICMP_* macros
-rw-r--r-- | Userland/Utilities/ping.cpp | 4 |
1 files 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; |