]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded
authorDave Hart <hart@ntp.org>
Sat, 31 Dec 2022 07:00:09 +0000 (02:00 -0500)
committerDave Hart <hart@ntp.org>
Sat, 31 Dec 2022 07:00:09 +0000 (02:00 -0500)
bk: 63afddf9oILBxmPDMsQr1xI-nVvzOA

ChangeLog
ntpd/ntp_keyword.h
ports/winnt/ntpd/ntp_iocompletionport.c

index eeceaa9f10cb57b56caf561eaab50a81ec861f63..a613379d6ba5b36971c940397845ab813cae00ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+* [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded <hart@ntp.org>
+
 ---
 (4.2.8p15) 2020/06/23 Released by Harlan Stenn <stenn@ntp.org>
 
index ab96b47c0d7a2c5a4c194c1eac4243ed1560d403..2ec72de38bd81d9c6a7377ee8228b558273928eb 100644 (file)
@@ -2,7 +2,7 @@
  * ntp_keyword.h
  * 
  * NOTE: edit this file with caution, it is generated by keyword-gen.c
- *      Generated 2020-02-13 08:56:28 UTC        diff_ignore_line
+ *      Generated 2022-12-29 07:50:55 UTC        diff_ignore_line
  *
  */
 #include "ntp_scanner.h"
index 9cf095225bc24009a65e50318ed60c0b9514d87d..960e1abacb22f41c1312f486e1af03fb3df2dc1b 100644 (file)
@@ -1489,6 +1489,7 @@ QueueSocketRecv(
                "QueueSocketRecv: cannot schedule socket receive";
 
        WSABUF  wsabuf;
+       DWORD   err;
        int     rc;
 
        lpo->onIoDone = OnSocketRecv;
@@ -1504,10 +1505,17 @@ QueueSocketRecv(
        wsabuf.buf = (char *)buff->recv_buffer;
        wsabuf.len = sizeof(buff->recv_buffer);
 
-       rc = WSARecvFrom(lpo->io.sfd, &wsabuf, 1, NULL, &lpo->ioFlags,
-                        &buff->recv_srcadr.sa, &buff->recv_srcadr_len, 
-                        &lpo->ol, NULL);
-       return !rc || IoResultCheck((DWORD)WSAGetLastError(), lpo, msgh);
+       do {
+               rc = WSARecvFrom(lpo->io.sfd, &wsabuf, 1, NULL, &lpo->ioFlags,
+                       &buff->recv_srcadr.sa, &buff->recv_srcadr_len,
+                       &lpo->ol, NULL);
+               if (!rc) {
+                       return TRUE;
+               }
+               err = (DWORD)WSAGetLastError();
+       } while (WSAENETRESET == err);  /* [Bug 3784] ICMP TTL exceeded */
+
+       return IoResultCheck(err, lpo, msgh);
 }
 
 /* ----------------------------------------------------------------- */