Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147136 - net-misc/ntp-4.2.2-4.2.4 - broken after IP-change
Summary: net-misc/ntp-4.2.2-4.2.4 - broken after IP-change
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
: 156602 163147 173548 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-11 00:10 UTC by cilly
Modified: 2007-04-06 10:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cilly 2006-09-11 00:10:54 UTC
ntpd is broken after an IP-change of the WAN-IP:

ntpd[18049]: sendto(192.53.103.104) (fd=23): Invalid argument
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-11 00:12:58 UTC
So fix your configuration and restart it? Or what are you exactly complaining about?

Comment 2 cilly 2006-09-11 00:59:14 UTC
ntpd is not designed to restart a better way is:

configure ntpd with LOCAL:

server 127.127.1.1
fudge 127.127.1.1 stratum 10
broadcastdelay 0.008

On IP-Down:

use unconfig to remove all servers except LOCAL so it looks like:

*LOCAL(1)        127.0.0.1       10   64   17 0.00000  0.000000 0.96858

The ntpd is running with the LOCAL server without interuption.

On IP-UP:

use addserver to add all servers again, now it should look like:
=LOCAL(1)        127.0.0.1       10   64   17 0.00000  0.000000 0.96858
=ptbtime2.ptb.de 0.0.0.0          1   64   17 0.02345  0.001455 0.96895
*ptbtime1.ptb.de 0.0.0.0          1   64   17 0.02438  0.001508 0.96858
=ntps1-0.cs.tu-b 0.0.0.0          1   64   13 0.02193  0.000333 1.39236

This works fine with ntp version net-misc/ntp-4.2.0.20040617-r3 and earlier.

With this ntp-version after an IP-change ntpd does not honor unconfig and addserver correctly, the servers get added but aren't synced. I consider this as a bug since restarting ntpd on an IP change is a rather dirty hack.
Comment 3 cilly 2006-09-11 01:18:38 UTC
I found a patch which adds ifreload (interface reload) command to ntpdc:

http://lists.ntp.isc.org/pipermail/bk-ntp-dev-send/2006-June/000599.html

It would be nice to have that as an option in an ebuild, i.e. with useflag: dynamicIP
Comment 4 cilly 2006-09-11 01:32:46 UTC
Additional info to the patch:

http://www.ece.udel.edu/~mills/ntp/html/ntpdc.html
Comment 5 cilly 2006-09-11 09:07:19 UTC
Another solution may be to make ntpd listen on wildcard-interface. It seems with this version of ntpd listening on wildcard interface is disabled:

 ntpd[6719]: Listening on interface wildcard, 0.0.0.0#123 Disabled
 ntpd[6719]: Listening on interface wildcard, ::#123 Disabled
Comment 6 cilly 2006-09-11 09:22:42 UTC
SORRY FOR THIS; BUT I HAD CONNECTION PROBLEMS SO HERE IS THE FULL TEXT:


Another solution may be to make ntpd listen on wildcard-interface. It seems with this version of ntpd listening on wildcard interface is disabled:

 ntpd[6719]: Listening on interface wildcard, 0.0.0.0#123 Disabled
 ntpd[6719]: Listening on interface wildcard, ::#123 Disabled

The previous ntpd listens on the wildcard-interface:

 ntpd[20142]: Listening on interface wildcard, 0.0.0.0#123
 ntpd[20142]: Listening on interface wildcard, ::#123

I have no idea, why this version of ntpd does not listen on wildcard-interface.
Comment 7 SpanKY gentoo-dev 2006-09-13 19:19:52 UTC
this will be part of the next release
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2006-11-29 08:26:04 UTC
*** Bug 156602 has been marked as a duplicate of this bug. ***
Comment 9 Danny Mayer 2006-11-29 09:43:06 UTC
This is not a bug. This is an intended feature. Packets arriving on any of the wildcard ports will be unceremoniously dropped.

What you really need here is the dynamic interface code that is now in 4.2.3 development. The 4.2.4 release version due out shortly will contain this code.

Danny
NTP Development
Comment 10 cilly 2006-11-29 09:44:15 UTC
(In reply to comment #9)
> This is not a bug. This is an intended feature. Packets arriving on any of the
> wildcard ports will be unceremoniously dropped.
> 
> What you really need here is the dynamic interface code that is now in 4.2.3
> development. The 4.2.4 release version due out shortly will contain this code.
> 
> Danny
> NTP Development
> 

thanks Danny for pointing this out
Comment 11 cilly 2007-01-22 00:21:58 UTC
ntp-4.2.2_p4: same bug
Comment 12 cilly 2007-01-22 02:30:11 UTC
ntp 4.2.4 is not working after an IP-change, ifreload does not reload the WAN-interface, addserver still refuses to work.

See:

https://ntp.isc.org/bugs/show_bug.cgi?id=416
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2007-01-22 07:13:08 UTC
*** Bug 163147 has been marked as a duplicate of this bug. ***
Comment 14 cilly 2007-01-22 15:29:57 UTC
Since all versions of net-misc/ntp-4.2.2 and ntp-4-2-4 have this bug I suggest to add net-misc/ntp-4.2.0.20040617-r3 to portage again, which is the last known version where the addserver command is working and so usable on servers, which dynamic IP.
Comment 15 cilly 2007-01-22 15:30:40 UTC
Informed Upstream
Comment 16 cilly 2007-01-22 15:35:35 UTC
conclusion so far:

EITHER make ntpd listen on wildcard interface again OR make the commands ifreload and addserver usable.
Comment 17 Danny Mayer 2007-01-23 01:41:05 UTC
(Why is this message form at the top? It means scrolling back and forth a lot.)

There is no need for addserver or anything else as of 4.2.4. If the server is nonreachable then it will just continue on. ntpd will rescan the interfaces and use whatever's available for interface addresses. You can adjust the rescan frequency on the command line (I think that's where it is). If you use ntpdc you need to set up a key that you use authenticate so you can make changes. Bug #416 may be due to an issue that Frank just fixed in ntp_intres.c (see bug #761 which needs to be updated). If you aren't using IPv6 or you are looking up a record which only has IPv4 addresses you shouldn't need to worry about this.

As far as I know, ifreload works. If not please file a bug report in ntp bugzilla. Make sure that you have authenticated yourself before you issue this command. You would only need it for IP-UP and even then if will do it by itself when the time interval for rescanning expires.

We will *not* be reenabling the wildcard interfaces in the future, it causes to many problems.

If you have a problem please include the log containing the errors and make sure that you are running ntp 4.2.4 or later. you can check this by running ntpq -c rv against the ntpd server.

BTW why do you have broadcastdelay in the configuration file? You don't have any broadcast or multicast clients.

Danny
Comment 18 cilly 2007-01-23 02:53:57 UTC
I tested ntp 4.2.4 after an IP-change, which means device ppp0 got a new IP.

After the IP-change, the server does not sync anymore to public servers, but switches to LOCAL as per configuration.

The log is showing the following errors:


Jan 23 03:38:56 pluto ntpd[17912]: sendto(192.53.103.104) (fd=23): Invalid argument
Jan 23 03:38:56 pluto ntpd[17912]: sendto(192.53.103.108) (fd=23): Invalid argument
Jan 23 03:39:59 pluto ntpd[17912]: sendto(192.53.103.108) (fd=23): Invalid argument
Jan 23 03:39:59 pluto ntpd[17912]: sendto(130.149.17.21) (fd=23): Invalid argument
Jan 23 03:40:01 pluto ntpd[17912]: sendto(192.53.103.104) (fd=23): Invalid argument
Jan 23 03:41:02 pluto ntpd[17912]: sendto(130.149.17.21) (fd=23): Invalid argument
Jan 23 03:41:03 pluto ntpd[17912]: sendto(192.53.103.108) (fd=23): Invalid argument
Jan 23 03:41:05 pluto ntpd[17912]: sendto(192.53.103.104) (fd=23): Invalid argument
Jan 23 03:42:06 pluto ntpd[17912]: sendto(130.149.17.21) (fd=23): Invalid argument
Jan 23 03:42:07 pluto ntpd[17912]: sendto(192.53.103.108) (fd=23): Invalid argument
Jan 23 03:42:09 pluto ntpd[17912]: sendto(192.53.103.104) (fd=23): Invalid argument
Jan 23 03:43:10 pluto ntpd[17912]: sendto(130.149.17.21) (fd=23): Invalid argument
Jan 23 03:43:11 pluto ntpd[17912]: sendto(192.53.103.108) (fd=23): Invalid argument
Jan 23 03:43:14 pluto ntpd[17912]: sendto(192.53.103.104) (fd=23): Invalid argument
Jan 23 03:44:15 pluto ntpd[17912]: sendto(192.53.103.108) (fd=23): Invalid argument
Jan 23 03:44:15 pluto ntpd[17912]: sendto(130.149.17.21) (fd=23): Invalid argument
Jan 23 03:44:20 pluto ntpd[17912]: sendto(192.53.103.104) (fd=23): Invalid argument

ntpq -p     remote           refid      st t when poll reach   delay   offset  jitter
============================================================================== 
ptbtime1.ptb.de .PTB.            1 u  970   64    0   30.867   -0.841   0.000 
ptbtime2.ptb.de .PTB.            1 u  969   64    0   31.073   -0.651   0.000 
ntps1-0.cs.tu-b .PPS.            1 u  965   64    0   65.565   16.410   0.000
*LOCAL(1)        .LOCL.          10 l   63   64  377    0.000    0.000   0.001

I tried to use ifreload from the commandline:

ntpdcntpdc> ifreload
Keyid: 888
MD5 Password: 
***Server reports data not foundntpdc> 

I double checked with ifstats and the ppp0 device still lists the old IP-address.

My Conclusion: ntp 4.2.4 can't handle ip-changes of the wan-interface, may be ifreload does not work.

ntpq -c rv
assID=0 status=0564 leap_none, sync_local_proto, 6 events, event_peer/strat_chg,version="ntpd 4.2.4@1.1437-o Tue Jan 23 02:22:20 UTC 2007 (1)",processor="i686", system="Linux/2.6.18.6", leap=00, stratum=11,precision=-20, rootdelay=0.000, rootdispersion=11.680, peer=21810,refid=LOCAL(1),reftime=c95ff607.bb6086f2  Tue, Jan 23 2007  3:48:39.731, poll=8,clock=c95ff639.aa74dbeb  Tue, Jan 23 2007  3:49:29.665, state=4,offset=0.000, frequency=87.389, jitter=0.001, noise=0.209,stability=0.145, tai=0

@Danny How do you know I don't have any broadcast clients?
Comment 19 SpanKY gentoo-dev 2007-01-24 05:18:20 UTC
i really dont see anything here that is Gentoo specific ... the issues seem to be known upstream and i'm not going to work on it ... i'll just pull down whatever updates upstream puts together

so really, you should be posting to an upstream bug report, not here
Comment 20 cilly 2007-01-24 05:31:08 UTC
The only gentoo-specific is related to my comment:

https://bugs.gentoo.org/show_bug.cgi?id=147136#c14

I vote for adding that version to portage until we have a ntp which handles ip-changes properly.

(btw, I informed Danny (upstream))
Comment 21 SpanKY gentoo-dev 2007-01-24 05:41:29 UTC
no thanks ... viewcvs exists if you want to fetch an older version
Comment 22 Danny Mayer 2007-01-27 03:58:48 UTC
Yes this discussion should be taken to the ntp bugzilla. You should also look at bug #765 and #766 over there which deal with some privilege issues. This may be what's happening.

You don't show any broadcastclient setup in your conf file and your display of the billboard tells me for sure.

Danny
Comment 23 cilly 2007-02-03 12:26:35 UTC
Hi Danny,

I am sick dealing with this issue. I switched to the old version of ntp which works perfectly, since it listens on wildcard interface and addserver is working.

Well, I still hope you will release a ntp which can handle ip-changes and where addserver is working. Additionally, I would suggest to add "listen on wildcard" as a compiler-option - leave it up to the user.

Thanks for your assistance & good luck.
Comment 24 Danny Mayer 2007-02-04 06:29:10 UTC
That may be but we will not be putting back support for wildcards and we will not be making this an option. There are too many problems with wildcards to support it. You are free to change the code in any way you want. If you have an issue with the NTP code please take it to the NTP bugzilla and not continue this here. This has already been marked as Resolved Upstream.

And please don't add me to the CC list. If I wanted to be notified I would have done that myseld.

Danny
Comment 25 cilly 2007-02-04 16:42:30 UTC
Bug @ upstream:

https://ntp.isc.org/bugs/show_bug.cgi?id=772
Comment 26 cilly 2007-02-04 16:46:46 UTC
Workaround:

Switch back to

net-misc/ntp-4.2.0.20040617-r3

This version has been removed from portage, so browse and get it here:

http://sources.gentoo.org/

and add it to portage overlay.
Comment 27 cilly 2007-02-04 18:38:50 UTC
2nd Workaround:

Use ntp-4.2.4 but without -u ntp:ntp, run as root. Otherwise ifreload is not working.
Comment 28 Jakub Moc (RETIRED) gentoo-dev 2007-04-06 10:49:30 UTC
*** Bug 173548 has been marked as a duplicate of this bug. ***