From cnh@foo.ems.mindspring.net Fri Jul 23 14:47:59 1999
Return-Path: <cnh@foo.ems.mindspring.net>
Received: from foo.ems.mindspring.net (foo.ems.mindspring.net [209.86.81.150])
	by hub.freebsd.org (Postfix) with ESMTP id 7792F14E3B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Jul 1999 14:47:57 -0700 (PDT)
	(envelope-from cnh@foo.ems.mindspring.net)
Received: (from cnh@localhost)
	by foo.ems.mindspring.net (8.9.3/8.9.3) id RAA11463;
	Fri, 23 Jul 1999 17:47:32 -0400 (EDT)
	(envelope-from cnh)
Message-Id: <199907232147.RAA11463@foo.ems.mindspring.net>
Date: Fri, 23 Jul 1999 17:47:32 -0400 (EDT)
From: "Christopher N. Harrell" <cnh@foo.ems.mindspring.net>
Reply-To: cnh@foo.ems.mindspring.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: xntpd doesn't handle interface aliases properly
X-Send-Pr-Version: 3.2

>Number:         12782
>Category:       bin
>Synopsis:       xntpd doesn't handle interface aliases properly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    roberto
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 23 14:50:00 PDT 1999
>Closed-Date:    Tue Mar 13 12:24:02 PST 2001
>Last-Modified:  Mon Jul 23 01:13:46 PDT 2001
>Originator:     Christopher N. Harrell
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
MindSpring Enterprises
>Environment:
	RELENG_3 and -CURRENT

>Description:

	xntpd creates a list of interfaces, but neglects aliases.  This is fixed
	in /usr/ports/net/ntp (ntpd version 4.0.93a) -- perhaps we should merge
	in the many bugfixes that've been made.

>How-To-Repeat:
	ntpserver% ifconfig e0 inet 10.0.0.2
	ntpserver% ifconfig lo0 inet 10.0.0.1 alias
	ntpserver% arp -S 10.0.0.1 auto perm pub
	ntpclient% ntpdate -d 10.0.0.1
	 transmit(10.0.0.1)
	 receive(10.0.0.2)
	 receive: server not found

>Fix:

	See /usr/ports/net/ntp for this and probably many others.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: sheldonh 
State-Changed-When: Mon Jul 26 04:23:54 PDT 1999 
State-Changed-Why:  
Are you in a position to produce a diff that addresses this issue? 


Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Jul 26 04:23:54 PDT 1999 
Responsible-Changed-Why:  
I'm keen on feedback. :-) 

From: Nick Hibma <nick.hibma@jrc.it>
To: freebsd-gnats-submit@freebsd.org, cnh@foo.ems.mindspring.net,
	sheldonh@freebsd.org
Cc:  
Subject: Re: bin/12782: xntpd doesn't handle interface aliases properly
Date: Mon, 26 Jul 1999 13:46:08 +0200

 Could you post your route info as well? 10.0.0.1 is normally on the same
 subnet as 10.0.0.2, but the interfaces aren't. The netmask for 10.x.x.x
 is by default 255.0.0.0 .
 
 Maybe you should try your How-To-Repeat by setting the netmask to
 255.255.255.0 and make the alias 10.1.0.1 and the other IP address
 10.0.0.2 .
 
 Cheers,
 Nick
 -- 
 ISIS/STA, T.P.270, Joint Research Centre, 21020 Ispra, Italy
 

From: Nick Hibma <nick.hibma@jrc.it>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/12782: xntpd doesn't handle interface aliases properly (fwd)
Date: Tue, 27 Jul 1999 09:40:00 +0200 (MET DST)

 ---------- Forwarded message ----------
 Date: Mon, 26 Jul 1999 18:06:42 -0400
 From: "Christopher N . Harrell" <cnh@mindspring.net>
 To: Nick Hibma <n_hibma@webweaving.org>
 Subject: Re: bin/12782: xntpd doesn't handle interface aliases properly
 
 Quoting Nick Hibma:
 > 
 > Could you post your route info as well? 10.0.0.1 is normally on the same
 > subnet as 10.0.0.2, but the interfaces aren't. The netmask for 10.x.x.x
 > is by default 255.0.0.0 .
 
 The netmask on the alias is actually 0xffffffff -- just forgot to type that
 part.
 > 
 > Maybe you should try your How-To-Repeat by setting the netmask to
 > 255.255.255.0 and make the alias 10.1.0.1 and the other IP address
 > 10.0.0.2 .
 
 The core of the problem is that th aliases on lo0 don't get their own socket.
 
 (see netstat -an on a machine configured as described and ntp_io.c's init_io().)
 
 cheers,
 Christopher
 
 
 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: aagero@eunet.no
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/12782: xntpd doesn't handle interface aliases properly
Date: Thu, 29 Jul 1999 18:47:22 +0200

 Hi there,
 
 Dag-Erling Smorgrav mentioned that you may have patches available that
 fix a problem reported on a FreeBSD Problem Report I'm looking at. It's
 PR 12782, which addresses xntpd's improper handling of interfaces.
 
 If you could comment, I'd greatly appreciate it. You can view the PR
 online at http://www.freebsd.org/cgi/query-pr.cgi?pr=12782 .
 
 Thanks,
 Sheldon.
 

From: =?iso-8859-1?Q?=C5ge_R=F8bekk?= <aagero@norway.eu.net>
To: Sheldon Hearn <sheldonh@uunet.co.za>
Cc:  
Subject: Re: bin/12782: xntpd doesn't handle interface aliases properly
Date: Fri, 30 Jul 1999 09:53:36 +0200

 --yLVHuoLXiP9kZBkt
 Content-Type: text/plain; charset=iso-8859-1
 Content-Transfer-Encoding: quoted-printable
 X-MIME-Autoconverted: from 8bit to quoted-printable by kirov.i.eunet.no id JAA20702
 
 Var det ikke Sheldon Hearn som sa:
 | =20
 |  Hi there,
 | =20
 |  Dag-Erling Smorgrav mentioned that you may have patches available that
 |  fix a problem reported on a FreeBSD Problem Report I'm looking at. It'=
 s
 |  PR 12782, which addresses xntpd's improper handling of interfaces.
 | =20
 |  If you could comment, I'd greatly appreciate it. You can view the PR
 |  online at http://www.freebsd.org/cgi/query-pr.cgi?pr=3D12782 .
 
 Our local setup here often demands that certain daemons listen to arbitra=
 ry addresses,
 including those non-primary addresses on the interfaces.  This patch only=
  checks to see
 if the address returned from SIOCGIFADDR differs from SIOCGIFCONF.  If it=
  does, then
 there are more addresses than the primary one.
 
 --=20
 =C5ge R=F8bekk, EUnet Norge AS
 
 --yLVHuoLXiP9kZBkt
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="ntp_io.c.patch"
 
 --- ntp_io.c~	Tue May 30 05:54:38 1995
 +++ ntp_io.c	Fri Jan 22 17:46:10 1999
 @@ -214,7 +214,7 @@
  #endif /* STREAMS_TLI */
  	char	buf[MAXINTERFACES*sizeof(struct ifreq)];
  	struct	ifconf	ifc;
 -	struct	ifreq	ifreq, *ifr;
 +	struct	ifreq	oifreq, ifreq, *ifr;
  	int n, i, j, vs, size;
  	struct sockaddr_in resmask;
  
 @@ -325,11 +325,16 @@
  		ioc.ic_len = sizeof(struct ifreq);
  		if(ioctl(vs, I_STR, &ioc)) {
  #else /* ! STREAMS_TLI */
 +		oifreq = ifreq; /* save old interface information from SIOCGIFCONF */
  		if (ioctl(vs, SIOCGIFADDR, (char *)&ifreq) < 0) {
  #endif /* STREAMS_TLI */
  			syslog(LOG_ERR, "get interface addr: %m");
  			continue;
  		}
 +		if (!strncmp(oifreq.ifr_name, ifreq.ifr_name, strlen(oifreq.ifr_name)))
 +			if (((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr.s_addr !=
 +			((struct sockaddr_in *)&oifreq.ifr_addr)->sin_addr.s_addr)
 +				ifreq = oifreq; /* Different from SIOCGIFADDR, probably an IP alias */
  
  		(void)strncpy(inter_list[i].name, ifreq.ifr_name,
  		    sizeof(inter_list[i].name));
 
 --yLVHuoLXiP9kZBkt--
 
 
Responsible-Changed-From-To: sheldonh->roberto 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Fri Mar 10 04:01:48 PST 2000 
Responsible-Changed-Why:  
We use the newer ntp package which comes with ntpd, not xntpd 
and the new package has a new maintainer. 

I'm leaving the state as feedback, because it'd be good to 
have feedback on whether this is still a problem with the 
new NTP4 package in CURRENT. 
State-Changed-From-To: feedback->closed 
State-Changed-By: des 
State-Changed-When: Tue Mar 13 12:24:02 PST 2001 
State-Changed-Why:  
No longer an issue. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=12782 
>Unformatted:
