mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
ping: Replace two magic numbers with ICMP_* macros
This commit is contained in:
parent
2b03e95354
commit
22c6783db2
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue