From owner-freebsd-questions Thu Oct 3 12: 1:56 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 912FE37B401 for ; Thu, 3 Oct 2002 12:01:55 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 154A443E4A for ; Thu, 3 Oct 2002 12:01:55 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.5) id g93J1s1l033047; Thu, 3 Oct 2002 14:01:54 -0500 (CDT) (envelope-from dan) Date: Thu, 3 Oct 2002 14:01:54 -0500 From: Dan Nelson To: Michael Palinski Cc: freebsd-questions@FreeBSD.ORG Subject: Re: ntp not working as expected Message-ID: <20021003190154.GB19343@dan.emsphone.com> References: <20021003143642.E8504@staff.msen.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021003143642.E8504@staff.msen.com> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Oct 03), Michael Palinski said: > FreeBSD 4.5-RELEASE-p20 > > virtual web server offering ssl os addresses are configured on the > loopback interface using lines in rc.conf like; > ifconfig_lo0_alias1="inet 148.59.66.1 netmask 255.255.255.255 " > > The code around line 306 of ntp/ntpd/ntp_io.c tries to prevent ntpd > from listening on these aliased interfaces but does not work. > netstat -a shows ntp listening on each of these addresses. It _looks_ like that code checks for two IPs in the same subnet, but it only works if the netmask for both interfaces is the same. This basically causes the test to always fail, since alias IPs have a netmask of 255.255.255.255. I think it really should use the largest of the two subnets: for (j=0; j < i; j++) { unsigned int mask = MAX(inter_list[j].mask.sin_addr.s_addr,inter_list[i].mask.sin_addr.s_addr); if (inter_list[j].sin.sin_addr.s_addr & mask == inter_list[i].sin.sin_addr.s_addr & mask ) { if (inter_list[j].flags & INT_LOOPBACK) inter_list[j] = inter_list[i]; break; } } -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message