gICMP_PingSlots[i].bArrived = 0;
hdr->ID = i;
hdr->Sequence = ~i;
- hdr->Checksum = htons( IPv4_Checksum((Uint16*)hdr, sizeof(buf)/2) );
+ hdr->Checksum = htons( IPv4_Checksum((Uint16*)buf, sizeof(buf)) );
ts = now();
end = ts + Interface->TimeoutDelay;
while( !gICMP_PingSlots[i].bArrived && now() < end) Threads_Yield();
- if(now() > end)
+ if( !gICMP_PingSlots[i].bArrived )
return -1;
return (int)( now() - ts );