pInfo->SendPacket->icmpheader.code = 0;
pInfo->SendPacket->icmpheader.checksum = 0;
pInfo->SendPacket->icmpheader.id = (USHORT)GetCurrentProcessId();
- pInfo->SendPacket->icmpheader.seq = iSeqNum;
+ pInfo->SendPacket->icmpheader.seq = htons((USHORT)iSeqNum);
/* calculate checksum of packet */
- pInfo->SendPacket->icmpheader.checksum = CheckSum((PUSHORT)&pInfo->SendPacket,
+ pInfo->SendPacket->icmpheader.checksum = CheckSum((PUSHORT)&pInfo->SendPacket->icmpheader,
sizeof(ICMP_HEADER) + PACKET_SIZE);
}
pInfo->lTimeStart = GetTime(pInfo);
iSockRet = sendto(pInfo->icmpSock, //socket
- (char *)pInfo->SendPacket, //buffer
- PACKET_SIZE, //size of buffer
+ (char *)&pInfo->SendPacket->icmpheader,//buffer
+ sizeof(ICMP_HEADER) + PACKET_SIZE,//size of buffer
0, //flags
(SOCKADDR *)&pInfo->dest, //destination
sizeof(pInfo->dest)); //address length
DebugPrint(_T("Rouge packet: header id, process id %d"), TTLExceedHdr->OrigIcmpHeader.id, GetCurrentProcessId());
return -1;
}
-#ifndef _WIN64
- _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart);
-#else
- _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart);
-#endif
+ _tprintf(_T("%3ld ms"), (ULONG)((pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart));
return 0;
case ECHO_REPLY :
DebugPrint(_T("Rouge packet: header id %d, process id %d"), IcmpHdr->icmpheader.id, GetCurrentProcessId());
return -1;
}
-#ifndef _WIN64
- _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart);
-#else
- _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart);
-#endif
+ _tprintf(_T("%3ld ms"), (ULONG)((pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart));
return 1;
case DEST_UNREACHABLE :
0,
pInfo->SendPacket);
- if (pInfo->SendPacket)
+ if (pInfo->RecvPacket)
HeapFree(GetProcessHeap(),
0,
pInfo->RecvPacket);