[ntp:questions] ntpdate with auth

Grzegorz Daniluk lin_g at o2.pl
Wed Jul 23 07:53:55 UTC 2008


Steve Kostecke wrote:
> You can include reference time sources in your ntp.conf
>
> The syntax is:
>
> server your.reference.server noselect
>   

Thank you very much, that is exactly what I was looking for.
Now I have another question. I would like to change the poll interval 
for those 'noselect' hosts so I figured out that I'll use ntpdc. Then I 
realized that the 'addserver' option doesn't support 'noselect'. I tried 
to add that flag so I did something like that in ntpdc_ops.c:

/while (pcmd->nargs > items) {
                if (STREQ(pcmd->argval[items].string, "prefer"))
                    flags |= CONF_FLAG_PREFER;
                else if (STREQ(pcmd->argval[items].string, "burst"))
                    flags |= CONF_FLAG_BURST;
                else if (STREQ(pcmd->argval[items].string, "dynamic"))
                    flags |= CONF_FLAG_DYNAMIC;
                /*///////////*/
                else if (STREQ(pcmd->argval[items].string, "noselect"))
                    flags |= CONF_FLAG_NOSELECT;
                /*///////////*/
                else if (STREQ(pcmd->argval[items].string, "iburst"))
                    flags |= CONF_FLAG_IBURST;
                else if (!refc && STREQ(pcmd->argval[items].string, 
"keyid"))
                    numtyp = 1;
                else if (!refc && STREQ(pcmd->argval[items].string, 
"version"))
                    numtyp = 2;
                else if (STREQ(pcmd->argval[items].string, "minpoll"))
                    numtyp = 3;
                else if (STREQ(pcmd->argval[items].string, "maxpoll"))
                    numtyp = 4;

/but when I tried to use my new ntpdc with noselect option I got 
following errors:

***Warning changing to older implementation
***Warning changing the request packet size from 160 to 48
***Server reports a format error in the received packet (shouldn't happen)
***Retrying command with old conf_peer size
***Server reports a format error in the received packet (shouldn't happen)

The other flags works perfect, I got these messages only with noselect.
So maybe I also need to add some code to ntpd so that it would 
understand a message with noselect flag ? I'm still not very familiar 
with ntpd code so maybe somebody tried to do that before or have any 
idea what's wrong and how to fix it ?

thank you very much for all your help

Grzegorz Daniluk



More information about the questions mailing list