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:
180:0a30cff6b36a
Parent:
179:55342264fca1
Child:
181:169881ecd52f
--- a/udp/dhcp/dhcp.c	Wed Dec 30 19:26:19 2020 +0000
+++ b/udp/dhcp/dhcp.c	Thu Dec 31 12:32:51 2020 +0000
@@ -273,11 +273,12 @@
     {
         case DHCPOFFER:
             if (DhcpTrace) { LogTime("DHCP <- offer ip "); Ip4AddressLog(yiaddr); Log("\r\n"); }
+            DhcpLocalIp = yiaddr; //Save the offered ip - should really be in another variable as we have not had the ACK yet from our request but hey ho.
             *pSizeTx = sendRequest(pPacketTx, DHCPREQUEST, siaddr, yiaddr);
             return BROADCAST;
         case DHCPACK:
             if (DhcpTrace) { LogTime("DHCP <- ack ip ");   Ip4AddressLog(yiaddr); Log("\r\n"); }
-            DhcpLocalIp = yiaddr;
+            DhcpLocalIp = yiaddr; //Save our IP
             elapsedLifeMsTimer = MsTimerCount;  //Start the life timer
             delayMs = MIN_REPEAT_DELAY_TIME_MS; //Set the delay time back to minimum
             break;