From: Dave Hart Date: Fri, 8 May 2009 22:44:33 +0000 (+0000) Subject: ntp_io.c: X-Git-Tag: NTP_4_2_5P175~7^2~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3133a26caa587ecc40feaef2a83c6a393f84d042;p=thirdparty%2Fntp.git ntp_io.c: make -I override -L, do not listen on unused interfaces bk: 4a04b5d151gGYlIKlGbkDRp9ppcRhA --- diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 855115054..77bd8c7fe 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -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"));