How NTP works

Hal Murray hmurray at megapathdsl.net
Fri Nov 25 18:54:21 UTC 2016


> That's the 'reftime' field in struct pkt.  Grepping, I find...that it really
> *doesn't* seem to be used.  But verifying this is confusing because there
> are other variables with reftime in their names.  You should both check me
> on it. 

We should scan ntp classic in case we botched something.

I took a look at the RFC.  The only use I saw was on page 83 as part of a 
sanity check filter.

        /*
         * Verify valid root distance.
         */
        if (r->rootdelay / 2 + r->rootdisp >= MAXDISP || p->reftime >
            r->xmt)
                return;                 /* invalid header values */

The MAXDISP above turns into sys_maxdisp in the code.

This looks like the corresponding code:
        if(scalbn((double)pkt->rootdelay/2.0 + (double)pkt->rootdisp, -16) >=
           sys_maxdisp) {
                peer->flash |= BOGON7;
                return;
        }
I don't see the reftime check.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list