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:
182:ff48c6ea91c1
Parent:
128:79052cb4a41c
Child:
183:ee809769bf89
--- a/udp/dns/dnslabel.c	Mon Jan 04 16:07:45 2021 +0000
+++ b/udp/dns/dnslabel.c	Sun Jan 10 11:52:19 2021 +0000
@@ -29,10 +29,12 @@
 {
     int i = 0;
     char c;
+    bool isExternal = false;
     
     while (i < size - 1)
     {
         c = *p++;
+        if (c == '.') isExternal = true;
         if (!c) break;
         *result++ = c;
         i++;
@@ -48,7 +50,7 @@
             i++;
         }
     }
-    if (protocol == DNS_PROTOCOL_UDNS && DhcpDomainName[0]) //Shouldn't do this in IPv6 as DHCP is IPv4 only
+    if (protocol == DNS_PROTOCOL_UDNS && !isExternal && DhcpDomainName[0]) //Shouldn't do this in IPv6 as DHCP is IPv4 only
     {
         if (i < size - 1)
         {