hmm, on Wed, Nov 21, 2007 at 11:50:59AM +0100, Otto Moerbeek said that
> So, did anybody test this?
>
> -Otto
>
> >
> > Index: client.c
> > ===================================================================
> > RCS file: /cvs/src/usr.sbin/ntpd/client.c,v
> > retrieving revision 1.76
> > diff -u -p -r1.76 client.c
> > --- client.c 1 May 2007 07:40:45 -0000 1.76
> > +++ client.c 17 Nov 2007 16:34:07 -0000
> > @@ -123,7 +123,8 @@ client_query(struct ntp_peer *p)
> > int tos = IPTOS_LOWDELAY;
> >
> > if (p->addr == NULL && client_nextaddr(p) == -1) {
> > - set_next(p, scale_interval(INTERVAL_QUERY_AGGRESSIVE));
> > + set_next(p, MAX(SETTIME_TIMEOUT,
> > + scale_interval(INTERVAL_QUERY_AGGRESSIVE)));
> > return (0);
> > }
> >
> > @@ -140,8 +141,8 @@ client_query(struct ntp_peer *p)
> > if (errno == ECONNREFUSED || errno == ENETUNREACH ||
> > errno == EHOSTUNREACH || errno == EADDRNOTAVAIL) {
> > client_nextaddr(p);
> > - set_next(p,
> > - scale_interval(INTERVAL_QUERY_AGGRESSIVE));
> > + set_next(p, MAX(SETTIME_TIMEOUT,
> > + scale_interval(INTERVAL_QUERY_AGGRESSIVE)));
> > return (-1);
> > } else
> > fatal("client_query connect");
my mirror still did not get this, so i applied manually.
first test case:
<new ntpd installed>
amaaq> alias p
p='ps -u'
amaaq> p -ax | grep ntpd
_ntp 18531 0.0 0.1 424 728 ?? Is 8:24PM 0:00.06 ntpd: ntp eng
root 27267 0.0 0.1 480 776 ?? Ss 8:24PM 0:00.01 ntpd: [priv]
amaaq> sudo kill 27267
<yank out ethernet cable, leave interface up, just curious>
amaaq> sudo /usr/sbin/ntpd -s
<hangs, after couple of "unsuccesful" ^C's i put back ethernet cable,
when line comes back up, terminates>
^C^C^C^CTerminating
second test case:
amaaq> p -ax | grep ntpd
f 30100 0.0 0.0 628 4 p3 R+ 10:17PM 0:00.00 grep ntpd (ks
amaaq> sudo ifconfig rl0 down
amaaq> sudo /usr/sbin/ntpd -s
<after 10-15s i get back shell, ntpd running>
ammaq>
amaaq> sudo sh /etc/netstart
<finish mail ;-) >
so to conclude, when no active interface is present it works.
would it be also so trivial to fix the first test case?
or perhaps i just didn't wait long enough for a timeot?
-f
--
a kick in the ass is a step forward.