#endif
#if defined(SYS_WINNT)
+#include "win32_io.h"
#include <isc/win32os.h>
/*
* Windows C runtime ioctl() can't deal properly with sockets,
#endif
-#ifdef SYS_WINNT
-/*
- * Windows 2000 systems incorrectly cause UDP sockets using WASRecvFrom
- * to not work correctly, returning a WSACONNRESET error when a WSASendTo
- * fails with an "ICMP port unreachable" response and preventing the
- * socket from using the WSARecvFrom in subsequent operations.
- * The function below fixes this, but requires that Windows 2000
- * Service Pack 2 or later be installed on the system. NT 4.0
- * systems are not affected by this and work correctly.
- * See Microsoft Knowledge Base Article Q263823 for details of this.
- */
-void
-connection_reset_fix(
- SOCKET fd,
- sockaddr_u * addr
- )
-{
- DWORD dw;
- BOOL bNewBehavior = FALSE;
- DWORD status;
-
- /*
- * disable bad behavior using IOCTL: SIO_UDP_CONNRESET
- * NT 4.0 has no problem
- */
- if (isc_win32os_majorversion() >= 5) {
- status = WSAIoctl(fd, SIO_UDP_CONNRESET, &bNewBehavior,
- sizeof(bNewBehavior), NULL, 0,
- &dw, NULL, NULL);
- if (SOCKET_ERROR == status)
- msyslog(LOG_ERR,
- "connection_reset_fix() failed for address %s: %m",
- stoa(addr));
- }
-}
-#endif
-
/*
* on Unix systems the stdio library typically
* makes use of file descriptors in the lower