X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Ficmp.c;h=16037199173abb974df8cae419ab4b5b41f0c917;hb=58c7107eb0a5ae254c135f2eaa6263751f1ebe67;hp=2cdc3f6735ce815c61e80d1063c4e3a19d4d788a;hpb=f903bcea88df0cf2e12583ae74e35c4bfb6760bf;p=tpg%2Facess2.git diff --git a/Modules/IPStack/icmp.c b/Modules/IPStack/icmp.c index 2cdc3f67..16037199 100644 --- a/Modules/IPStack/icmp.c +++ b/Modules/IPStack/icmp.c @@ -81,7 +81,7 @@ void ICMP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buff //Log_Debug("ICMPv4", "Replying"); hdr->Type = ICMP_ECHOREPLY; hdr->Checksum = 0; - hdr->Checksum = htons( IPv4_Checksum(hdr, Length) ); + hdr->Checksum = htons( IPv4_Checksum( (Uint16*)hdr, Length/2 ) ); //Log_Debug("ICMPv4", "Checksum = 0x%04x", hdr->Checksum); IPv4_SendPacket(Interface, *(tIPv4*)Address, 1, ntohs(hdr->Sequence), Length, hdr); break; @@ -117,7 +117,7 @@ int ICMP_Ping(tInterface *Interface, tIPv4 Addr) gICMP_PingSlots[i].bArrived = 0; hdr->ID = i; hdr->Sequence = ~i; - hdr->Checksum = htons( IPv4_Checksum(hdr, sizeof(buf)) ); + hdr->Checksum = htons( IPv4_Checksum((Uint16*)hdr, sizeof(buf)/2) ); ts = now();