Andrew Boyson / net

Dependents:   oldheating gps motorhome heating

Files at this revision

API Documentation at this revision

Comitter:
andrewboyson
Date:
Wed Dec 05 18:30:37 2018 +0000
Parent:
93:580fc113d9e9
Child:
95:b9a99049016a
Commit message:
Fixed bug - incorrect MSS being sent from a polled sync: expected 1440 but had -60. Traced to buffer datalength in EthPollForPacketToSend being set to zero instead of being calculated from the buffer length - headersize.

Changed in this revision

eth/eth.c Show annotated file Show diff for this revision Revisions of this file
--- a/eth/eth.c	Sun Dec 02 18:40:35 2018 +0000
+++ b/eth/eth.c	Wed Dec 05 18:30:37 2018 +0000
@@ -118,7 +118,8 @@
     struct header * pHeader = (struct header*)pPacket;
     void* pData = (char*)pPacket + sizeof(struct header);
     
-    int dataLength = 0;
+    int dataLength = *pSize - sizeof(struct header);
+    if (dataLength > MTU) dataLength = MTU; //Limit the transmitted length to the maximum ethernet frame payload length
     protocol = 0;
     int action = DO_NOTHING;
     if (!action)