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:
parent
8f3d4e69c3
commit
4a13a5484a
8 changed files with 18 additions and 50 deletions
|
@ -605,7 +605,7 @@ static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddre
|
|||
Checksum += SwapEndian_16(PROTOCOL_TCP);
|
||||
Checksum += SwapEndian_16(TCPOutSize);
|
||||
|
||||
for (uint8_t CurrWord = 0; CurrWord < (TCPOutSize >> 1); CurrWord++)
|
||||
for (uint16_t CurrWord = 0; CurrWord < (TCPOutSize >> 1); CurrWord++)
|
||||
Checksum += ((uint16_t*)TCPHeaderOutStart)[CurrWord];
|
||||
|
||||
if (TCPOutSize & 0x01)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue