X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FIPStack%2Ficmp.c;h=80974ef15f780482f95df563ce5cf1a574352e48;hb=dfe6387e68caf8ffd75f7814131ca2af3be53eb1;hp=f1355fa6eadc9197cd7785ca32d8e241b76d5154;hpb=849329d50395b44ac97c5b5145fc2df0749eace2;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/IPStack/icmp.c b/KernelLand/Modules/IPStack/icmp.c index f1355fa6..80974ef1 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(now() >= end) return -1; return (int)( now() - ts );