Improve and of ICMP messages on Windows.
When an ICMP message is received on Windows 10 for a UDP socket,
WSAECONNRESET is reported as an error. In this case, just read
again.
Thanks to nxrighthere for reporting the issue and helping to
nail it down.
This fixes
@@ -323,12 +323,10 @@ recv_function_raw(void *arg)
nResult = WSARecvFrom(SCTP_BASE_VAR(userspace_rawsctp), recv_iovec, MAXLEN_MBUF_CHAIN, &ncounter, &flags, (struct sockaddr *)&from, &fromlen, NULL, NULL);
if (nResult != 0) {
m_ErrorCode = WSAGetLastError();
- if (m_ErrorCode == WSAETIMEDOUT) {
- continue;
- }
if ((m_ErrorCode == WSAENOTSOCK) || (m_ErrorCode == WSAEINTR)) {
break;
}
+ continue;
}
n = ncounter;
#else
@@ -516,11 +514,11 @@ recv_function_raw6(void *arg)
}
if (nResult != 0) {
m_ErrorCode = WSAGetLastError();
- if (m_ErrorCode == WSAETIMEDOUT)
- continue;
- if (m_ErrorCode == WSAENOTSOCK || m_ErrorCode == WSAEINTR)
+ if ((m_ErrorCode == WSAENOTSOCK) || (m_ErrorCode == WSAEINTR)) {
break;
}
+ continue;
+ }
n = ncounter;
#else
memset(&msg, 0, sizeof(struct msghdr));
@@ -728,12 +726,10 @@ recv_function_udp(void *arg)
}
if (nResult != 0) {
m_ErrorCode = WSAGetLastError();
- if (m_ErrorCode == WSAETIMEDOUT) {
- continue;
- }
if ((m_ErrorCode == WSAENOTSOCK) || (m_ErrorCode == WSAEINTR)) {
break;
}
+ continue;
}
n = ncounter;
#endif
@@ -935,12 +931,10 @@ recv_function_udp6(void *arg)
}
if (nResult != 0) {
m_ErrorCode = WSAGetLastError();
- if (m_ErrorCode == WSAETIMEDOUT) {
- continue;
- }
if ((m_ErrorCode == WSAENOTSOCK) || (m_ErrorCode == WSAEINTR)) {
break;
}
+ continue;
}
n = ncounter;
#endif
