rept fix
This commit is contained in:
12
srcs/main.c
12
srcs/main.c
@ -285,6 +285,8 @@ int main(int argc, char** argv) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if (icmp_reply->code) {}
|
||||
|
||||
int old_checksum = icmp_reply->checksum;
|
||||
icmp_reply->checksum = 0;
|
||||
|
||||
@ -310,11 +312,11 @@ int main(int argc, char** argv) {
|
||||
max = (((max) > (tmp)) ? (max) : (tmp));
|
||||
avg += tmp;
|
||||
stddev += tmp * tmp;
|
||||
// if (icmp_reply->un.echo.sequence <= recvd) {
|
||||
// rept++;
|
||||
// } else {
|
||||
recvd++;
|
||||
// }
|
||||
if (icmp_reply->un.echo.sequence < recvd) {
|
||||
rept++;
|
||||
} else {
|
||||
recvd++;
|
||||
}
|
||||
}
|
||||
} else if (ret == 0) {
|
||||
printf("No reply received within the timeout period\n");
|
||||
|
Reference in New Issue
Block a user