Fixed RNDISEthernet demos crashing when calculating checksums for Ethernet/TCP packets of more than ~500 bytes due to an overflow in the checksum calculation loop (thanks to Kevin Malec).

Removed string Attributes from the Service Discovery Protocol code to minimise the potential points of failure while the base code is being debugged.
This commit is contained in:
Dean Camera 2010-05-25 06:14:37 +00:00
parent 8f3d4e69c3
commit 4a13a5484a
8 changed files with 18 additions and 50 deletions

View file

@ -125,7 +125,7 @@ uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes)
uint16_t* Words = (uint16_t*)Data;
uint32_t Checksum = 0;
for (uint8_t CurrWord = 0; CurrWord < (Bytes >> 1); CurrWord++)
for (uint16_t CurrWord = 0; CurrWord < (Bytes >> 1); CurrWord++)
Checksum += Words[CurrWord];
while (Checksum & 0xFFFF0000)