On Mon, Sep 14, 2009 at 11:23 AM, Paul Fleischer <p...@xpg.dk> wrote: > First, the network communication will be moved to another port that > 123. Let's assume it's 1234 for now.
I would like to see ntpd support unprivileged operation for testing purposes, including using a local port > 1024. The approach I have been considering is adding a "port" option to the association commands like server and peer in ntp.conf, with the secondary or unprivileged ntpd still defaulting to remote port 123. > Second, rather than using clock_gettime() and adjtime() it will use > calls that modify a second clock which is implemented in the Linux > kernel. For my purposes, a test unprivileged ntpd would modify a fictional system clock composed within ntpd using the real system clock modified by frequency and offset changes which normally would be applied to the system clock. This is a trickier bit of code to get right than the UDP port change. I'm curious how your second clock would be used, and what mechanism might be used to let you cleanly intercept the clock-affecting calls without requiring local patches to the NTP code. > If I run the modified ntpd with the above configurations, it seems > that the communicate with each other. However, ntpq behaves strange. > > Running "ntpq -c peers" on PC2 gives: > remote refid st t when poll reach delay offset jitter > ============================================================================== > > Running "ntpq -c lassociations" on PC2 gives: > ind assID status conf reach auth condition last_event cnt > =========================================================== > 1 10139 8000 yes yes none reject > 2 10140 9614 yes yes none sys.peer reachable 1 Your patch missed a questionable bit of code I coincidentally am likely to remove from ntpq-subs.c do_printpeers() line 1571: /* * Check to see if the srcport is NTP's port. If not this probably * isn't a valid peer association. */ if (havevar[HAVE_SRCPORT] && srcport != NTP_PORT) return (1); Remove that code and your ntpq should be much happier. It appears to have been added as a sanity check, but it's not a very good one. Cheers, Dave Hart _______________________________________________ questions mailing list questions@lists.ntp.org https://lists.ntp.org/mailman/listinfo/questions