Bug 12782 - xntpd doesn't handle interface aliases properly
Summary: xntpd doesn't handle interface aliases properly
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 3.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ollivier Robert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-07-23 22:50 UTC by Christopher N. Harrell
Modified: 2001-07-23 09:13 UTC (History)
0 users

See Also:


Attachments
ntp_io.c.patch (1022 bytes, patch)
1999-07-30 08:53 UTC, aagero
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher N. Harrell 1999-07-23 22:50:00 UTC
	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.

Fix: 

See /usr/ports/net/ntp for this and probably many others.
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
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 1999-07-26 12:23:54 UTC
State Changed
From-To: open->feedback

Are you in a position to produce a diff that addresses this issue? 


Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 1999-07-26 12:23:54 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I'm keen on feedback. :-) 

Comment 3 nick.hibma 1999-07-26 12:46:08 UTC
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
Comment 4 nick.hibma 1999-07-27 08:40:00 UTC
---------- 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
Comment 5 Sheldon Hearn 1999-07-29 17:47:22 UTC
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.
Comment 6 aagero 1999-07-30 08:53:36 UTC
Var det ikke Sheldon Hearn som sa:
|  
|  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 .

Our local setup here often demands that certain daemons listen to arbitrary 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.

-- 
Åge Røbekk, EUnet Norge AS
Comment 7 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-10 12:01:48 UTC
Responsible Changed
From-To: sheldonh->roberto

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. 
Comment 8 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-03-13 20:24:02 UTC
State Changed
From-To: feedback->closed

No longer an issue.