Reactos

[PING] Update SendBuffer fill method (#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.

authored by

Curtis Wilson and committed by
GitHub
8e2d1b35 787f81f3

+6 -1
+6 -1
base/applications/network/ping/ping.c
··· 432 432 exit(1); 433 433 } 434 434 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))); 436 440 } 437 441 438 442 if (Family == AF_INET6) ··· 483 487 ReplyBuffer, ReplySize, Timeout); 484 488 } 485 489 490 + /* TODO: Compare ReplyBuffer data to SendBuffer. */ 486 491 free(SendBuffer); 487 492 488 493 if (Status == 0)