X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FIPStack%2Ficmp.c;h=66f0f96a6c3b912b17436bb047d161a19d54be74;hb=4d184c30a3385600c0d87a2f93b4259c8c973e73;hp=f1355fa6eadc9197cd7785ca32d8e241b76d5154;hpb=849329d50395b44ac97c5b5145fc2df0749eace2;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/IPStack/icmp.c b/KernelLand/Modules/IPStack/icmp.c index f1355fa6..66f0f96a 100644 --- a/KernelLand/Modules/IPStack/icmp.c +++ b/KernelLand/Modules/IPStack/icmp.c @@ -121,7 +121,7 @@ int ICMP_Ping(tInterface *Interface, tIPv4 Addr) 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(); @@ -133,7 +133,7 @@ int ICMP_Ping(tInterface *Interface, tIPv4 Addr) 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 );