]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_io.c:
authorDave Hart <hart@ntp.org>
Fri, 8 May 2009 22:44:33 +0000 (22:44 +0000)
committerDave Hart <hart@ntp.org>
Fri, 8 May 2009 22:44:33 +0000 (22:44 +0000)
  make -I override -L, do not listen on unused interfaces

bk: 4a04b5d151gGYlIKlGbkDRp9ppcRhA

ntpd/ntp_io.c

index 8551150541e61bf30c8e038be3ad2354e0acc19d..77bd8c7fea08c2232df01ce290b82404fb051d71 100644 (file)
@@ -1085,11 +1085,6 @@ address_okay(isc_interface_t *isc_if) {
                                return (ISC_TRUE);
                        }
        }
-       if (listen_to_virtual_ips == 0  && 
-               (strchr(isc_if->name, (int)':') != NULL)) {
-               DPRINTF(4, ("address_okay: virtual ip/alias - FAIL\n"));
-               return (ISC_FALSE);
-       }
        /*
         * Check if the interface is specific
         */
@@ -1101,6 +1096,11 @@ address_okay(isc_interface_t *isc_if) {
                                return (ISC_TRUE);
                        }
        }
+       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 (interface_optioncount > 0) {
                DPRINTF(4, ("address_okay: FAIL\n"));
                return (ISC_FALSE);
@@ -1404,18 +1404,11 @@ update_interfaces(
 
                /* 
                 * 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) == ISC_TRUE) {
-                       interface.ignore_packets = ISC_FALSE;
-               }
-               else {
-                       interface.ignore_packets = ISC_TRUE;
-               }
+               if (!address_okay(&isc_if))
+                       continue;
+                       
+               interface.ignore_packets = ISC_FALSE;
 
                DPRINT_INTERFACE(4, (&interface, "examining ", "\n"));