Skip to content

Commit 8e2d1b3

Browse files
[PING] Update SendBuffer fill method (reactos#7782)
The ping utility found in various versions of Windows fills the optional data field in the ICMP echo request structure with ASCII characters from 'a' to 'w' wrapping back around until SendBuffer is full. Future TO-DO: Compare ReplyBuffer data to SendBuffer.
1 parent 787f81f commit 8e2d1b3

File tree

1 file changed

+6
-1
lines changed
  • base/applications/network/ping

1 file changed

+6
-1
lines changed

base/applications/network/ping/ping.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,11 @@ Ping(void)
432432
exit(1);
433433
}
434434

435-
ZeroMemory(SendBuffer, RequestSize);
435+
/* Windows ping utility fills the optional data field with
436+
* ASCII characters from 'a' to 'w', wrapping back around
437+
* until SendBuffer is full. */
438+
for (ULONG i = 0; i < RequestSize; i++)
439+
((PUCHAR)SendBuffer)[i] = (UCHAR)('a' + (i % ('w' - 'a' + 1)));
436440
}
437441

438442
if (Family == AF_INET6)
@@ -483,6 +487,7 @@ Ping(void)
483487
ReplyBuffer, ReplySize, Timeout);
484488
}
485489

490+
/* TODO: Compare ReplyBuffer data to SendBuffer. */
486491
free(SendBuffer);
487492

488493
if (Status == 0)

0 commit comments

Comments
 (0)