return (ISC_TRUE);
}
/*
- * Check if the address is limit
+ * Check if the IP address matches one given to -I, which if given
+ * limits interfaces/addresses to be used to those listed with -I.
*/
- if (ISC_LIST_HEAD(limit_address_list)!= NULL) {
+ {
const limit_address_t *laddr;
for (laddr = ISC_LIST_HEAD(limit_address_list); laddr != NULL; laddr = ISC_LIST_NEXT(laddr, link))
if (isc_netaddr_equal(&(isc_if->address), laddr->addr)) {
}
}
/*
- * Check if the interface is specific
+ * Check if the interface name was specified with an -I option.
*/
- if (ISC_LIST_HEAD(specific_interface_list)!= NULL) {
+ {
specific_interface_t *iface;
for (iface = ISC_LIST_HEAD(specific_interface_list); iface != NULL; iface = ISC_LIST_NEXT(iface, link))
if (strcasecmp(isc_if->name, iface->name) == 0) {
return (ISC_TRUE);
}
}
+ /*
+ * Check if we are excluding virtual IPs/aliases, and if so, is
+ * this interface such?
+ */
if (listen_to_virtual_ips == 0 &&
(strchr(isc_if->name, (int)':') != NULL)) {
DPRINTF(4, ("address_okay: virtual ip/alias - FAIL\n"));
return (ISC_FALSE);
}
+ /*
+ * If any -I options were given, only listed interfaces and
+ * addresses are used.
+ */
if (interface_optioncount > 0) {
DPRINTF(4, ("address_okay: FAIL\n"));
return (ISC_FALSE);
/*
* Check to see if we are going to use the interface
+ * If we don't use it we mark it to drop any packet
+ * received but we still must create the socket and
+ * bind to it. This prevents other apps binding to it
+ * and potentially causing problems with more than one
+ * process fiddling with the clock
*/
- if (!address_okay(&isc_if))
+ if (address_okay(&isc_if) == ISC_TRUE) {
+ interface.ignore_packets = ISC_FALSE;
+ }
+ else {
+#ifndef NO_LISTEN_READ_DROP
+ interface.ignore_packets = ISC_TRUE;
+#else
continue;
-
- interface.ignore_packets = ISC_FALSE;
+#endif
+ }
DPRINT_INTERFACE(4, (&interface, "examining ", "\n"));
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
+ <File
+ RelativePath="..\..\..\ntpd\cmd_args.c"
+ >
+ </File>
<File
RelativePath="nt_clockstuff.c"
>
RelativePath="..\include\clockstuff.h"
>
</File>
- <File
- RelativePath="..\..\..\ntpd\cmd_args.c"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
<File
RelativePath="..\include\config.h"
>