A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.

Dependents:   oldheating gps motorhome heating

Revision:
98:b977424ec7f7
Parent:
97:d91f7db00235
Child:
136:8a65abb0dc63
--- a/eth/eth.c	Wed Jan 02 17:48:38 2019 +0000
+++ b/eth/eth.c	Thu Jan 03 17:23:38 2019 +0000
@@ -58,6 +58,7 @@
 }
 int EthHandlePacket(void* pPacketRx, int sizeRx, void* pPacketTx, int* pSizeTx)
 {
+    int lastFaultPoint = FaultPoint;
     FaultPoint = FAULT_POINT_EthHandlePacket;
     
     tracePacket = pPacketRx;
@@ -72,14 +73,14 @@
         
     if (!MacAccept(pHeaderRx->dst))
     {
-        FaultPoint = 0;
+        FaultPoint = lastFaultPoint;
         return DO_NOTHING;
     }
     
     protocol = NetToHost16(pHeaderRx->typ);
     if (protocol < 1500)
     {
-        FaultPoint = 0;
+        FaultPoint = lastFaultPoint;
         return DO_NOTHING; //drop 802.3 messages
     }
 
@@ -104,7 +105,7 @@
     }
     if (!action)
     {
-        FaultPoint = 0;
+        FaultPoint = lastFaultPoint;
         return DO_NOTHING;
     }
         
@@ -117,7 +118,7 @@
     
     if (ActionGetTracePart(action)) LogHeader(pHeaderTx);
     
-    FaultPoint = 0;
+    FaultPoint = lastFaultPoint;
     return action;
 }
 int EthPollForPacketToSend(void* pPacket, int* pSize)