wildcard socket to workaround a bug in NT's getsockname().
bk: 489b428fczZOmvjtp5I1T8xbsa8txg
+* [Bug 450] Windows only: Under original Windows NT we must not discard the
+ wildcard socket to workaround a bug in NT's getsockname().
* [Bug 959] Refclock on Windows not properly releasing recvbuffs.
* [Bug 993] Fix memory leak when fetching system messages.
* [Bug 987] Wake up the resolver thread/process when a new interface has
#include "openssl/rand.h"
#endif /* OPENSSL */
+#ifdef SYS_WINNT
+extern int accept_wildcard_if_for_winnt;
+#endif
+
/*
* Table of valid association combinations
* ---------------------------------------
* PASSIVE | e 1 e 0 0 0
* CLIENT | e 0 0 0 1 1
* SERVER | e 0 0 0 0 0
- * BCAST | e 0 0 0 0 0
+ * BCAST | e 0 0 0 0 0
* BCLIENT | e 0 0 0 e 1
*
* One point to note here: a packet in BCAST mode can potentially match
* crypto will not work without knowing the own transmit address
*/
if (interface != NULL && interface->flags & INT_WILDCARD)
- interface = NULL;
+#ifdef SYS_WINNT
+ if ( !accept_wildcard_if_for_winnt )
+#endif
+ interface = NULL;
+
return interface;
}
#include "ntservice.h"
#include "clockstuff.h"
#include "ntp_iocompletionport.h"
+#include "isc/win32os.h"
#ifdef DEBUG
#include <crtdbg.h>
#endif
static int glb_argc;
static char **glb_argv;
HANDLE hServDoneEvent = NULL;
+int accept_wildcard_if_for_winnt;
extern volatile int debug;
extern char *progname;
glb_argc = argc;
glb_argv = argv;
- /* Command line users should put -f in the options */
+ /* Under original Windows NT we must not discard the wildcard */
+ /* socket to workaround a bug in NT's getsockname(). */
+ if ( isc_win32os_majorversion() <= 4 )
+ accept_wildcard_if_for_winnt = 1;
+
+ /* Command line users should put -n in the options */
while (argv[i]) {
if (!_strnicmp(argv[i], "-d", 2) ||
!strcmp(argv[i], "-q") ||