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:
139:1f3641abc07f
Parent:
138:5ff0c7069300
--- a/udp/ntp/ntpclientreply.c	Sun Apr 07 18:36:42 2019 +0000
+++ b/udp/ntp/ntpclientreply.c	Mon Apr 08 10:53:19 2019 +0000
@@ -22,8 +22,13 @@
         if (NetTraceStack) traceback();
         NtpLogHeader(pPacket);
     }
+    uint64_t ori = NtpHdrGetOriTimeStamp(pPacket);
+    if (NtpClientQueryTime == 0 || ori != NtpClientQueryTime)
+    {
+        LogTimeF("NtpClient error: unsolicited reply\r\n");
+        return;
+    }
     
-    uint64_t ori = NtpHdrGetOriTimeStamp(pPacket);
     uint64_t rec = NtpHdrGetRecTimeStamp(pPacket);
     int      li  = NtpHdrGetLI          (pPacket);