From: Dave Hart Date: Sat, 31 Dec 2022 07:00:09 +0000 (-0500) Subject: [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded X-Git-Tag: NTP_4_2_8P16~51^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81247155aaacf498fe9d1be0614b99facda3dbda;p=thirdparty%2Fntp.git [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded bk: 63afddf9oILBxmPDMsQr1xI-nVvzOA --- diff --git a/ChangeLog b/ChangeLog index eeceaa9f1..a613379d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* [Bug 3784] high-load ntpd on Windows deaf after enough ICMP TTL exceeded + --- (4.2.8p15) 2020/06/23 Released by Harlan Stenn diff --git a/ntpd/ntp_keyword.h b/ntpd/ntp_keyword.h index ab96b47c0..2ec72de38 100644 --- a/ntpd/ntp_keyword.h +++ b/ntpd/ntp_keyword.h @@ -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" diff --git a/ports/winnt/ntpd/ntp_iocompletionport.c b/ports/winnt/ntpd/ntp_iocompletionport.c index 9cf095225..960e1abac 100644 --- a/ports/winnt/ntpd/ntp_iocompletionport.c +++ b/ports/winnt/ntpd/ntp_iocompletionport.c @@ -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); } /* ----------------------------------------------------------------- */