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:
190:c4415a7253f5
Parent:
160:6a1d1d368f80
Child:
191:33392a61182e
--- a/udp/dns/dnsname.c	Thu Jan 21 13:34:33 2021 +0000
+++ b/udp/dns/dnsname.c	Thu Jan 21 14:56:55 2021 +0000
@@ -92,6 +92,7 @@
 }
 bool DnsNameCompareIp4(char *pStart, uint32_t ip)
 {
+    char ipBytes[4];
     int field = 0;
     int depth = 0;
     char* p = pStart;
@@ -133,8 +134,7 @@
                     byte += *p - '0';
                     p++;
                 }
-                if (byte != (ip & 0xFF)) return false;
-                ip >>= 8;
+                int ipByte = (ip >> 8 * (3 - field)) & 0xFF;
             }
             else if (field == 4)
             {