From 02fe2bb33c92687f50cb3eb73ffd620146aa5953 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sun, 11 Feb 2024 07:41:52 +0900 Subject: [PATCH] ping: send the usual number of payload bytes --- apps/ping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/ping.c b/apps/ping.c index 31feac2f..f208df41 100644 --- a/apps/ping.c +++ b/apps/ping.c @@ -22,7 +22,7 @@ #include #include -#define BYTES_TO_SEND 56 +#define BYTES_TO_SEND 64 struct ICMP_Header { uint8_t type, code; @@ -87,7 +87,7 @@ int main(int argc, char * argv[]) { dest.sin_family = AF_INET; memcpy(&dest.sin_addr.s_addr, host->h_addr, host->h_length); - printf("PING %s (%s) %d data bytes\n", argv[1], addr, BYTES_TO_SEND); + printf("PING %s (%s) %d data bytes\n", argv[1], addr, BYTES_TO_SEND - 8); struct ICMP_Header * ping = malloc(BYTES_TO_SEND); ping->type = 8; /* request */