aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/usage.src.h4
-rw-r--r--networking/ntpd.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/include/usage.src.h b/include/usage.src.h
index b73ca4d89..2445c1b9b 100644
--- a/include/usage.src.h
+++ b/include/usage.src.h
@@ -2788,7 +2788,7 @@ INSERT
2788 "Address: 127.0.0.1\n" 2788 "Address: 127.0.0.1\n"
2789 2789
2790#define ntpd_trivial_usage \ 2790#define ntpd_trivial_usage \
2791 "[-dnqwl] [-S PROG] [-p PEER]..." 2791 "[-dnqNw"IF_FEATURE_NTPD_SERVER("l")"] [-S PROG] [-p PEER]..."
2792#define ntpd_full_usage "\n\n" \ 2792#define ntpd_full_usage "\n\n" \
2793 "NTP client/server\n" \ 2793 "NTP client/server\n" \
2794 "\nOptions:" \ 2794 "\nOptions:" \
@@ -2797,7 +2797,9 @@ INSERT
2797 "\n -q Quit after clock is set" \ 2797 "\n -q Quit after clock is set" \
2798 "\n -N Run at high priority" \ 2798 "\n -N Run at high priority" \
2799 "\n -w Do not set time (only query peers), implies -n" \ 2799 "\n -w Do not set time (only query peers), implies -n" \
2800 IF_FEATURE_NTPD_SERVER( \
2800 "\n -l Run as server on port 123" \ 2801 "\n -l Run as server on port 123" \
2802 ) \
2801 "\n -S PROG Run PROG after stepping time, stratum change, and every 11 mins" \ 2803 "\n -S PROG Run PROG after stepping time, stratum change, and every 11 mins" \
2802 "\n -p PEER Obtain time from PEER (may be repeated)" \ 2804 "\n -p PEER Obtain time from PEER (may be repeated)" \
2803 2805
diff --git a/networking/ntpd.c b/networking/ntpd.c
index ca4afa045..b7bd239b5 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -49,7 +49,7 @@
49/* High-level description of the algorithm: 49/* High-level description of the algorithm:
50 * 50 *
51 * We start running with very small poll_exp, BURSTPOLL, 51 * We start running with very small poll_exp, BURSTPOLL,
52 * in order to quickly accumulate INITIAL_SAMLPES datapoints 52 * in order to quickly accumulate INITIAL_SAMPLES datapoints
53 * for each peer. Then, time is stepped if the offset is larger 53 * for each peer. Then, time is stepped if the offset is larger
54 * than STEP_THRESHOLD, otherwise it isn't; anyway, we enlarge 54 * than STEP_THRESHOLD, otherwise it isn't; anyway, we enlarge
55 * poll_exp to MINPOLL and enter frequency measurement step: 55 * poll_exp to MINPOLL and enter frequency measurement step:
@@ -77,7 +77,7 @@
77 77
78#define RETRY_INTERVAL 5 /* on error, retry in N secs */ 78#define RETRY_INTERVAL 5 /* on error, retry in N secs */
79#define RESPONSE_INTERVAL 15 /* wait for reply up to N secs */ 79#define RESPONSE_INTERVAL 15 /* wait for reply up to N secs */
80#define INITIAL_SAMLPES 4 /* how many samples do we want for init */ 80#define INITIAL_SAMPLES 4 /* how many samples do we want for init */
81 81
82/* Clock discipline parameters and constants */ 82/* Clock discipline parameters and constants */
83 83
@@ -1972,14 +1972,14 @@ int ntpd_main(int argc UNUSED_PARAM, char **argv)
1972 idx2peer = xzalloc(sizeof(idx2peer[0]) * cnt); 1972 idx2peer = xzalloc(sizeof(idx2peer[0]) * cnt);
1973 pfd = xzalloc(sizeof(pfd[0]) * cnt); 1973 pfd = xzalloc(sizeof(pfd[0]) * cnt);
1974 1974
1975 /* Countdown: we never sync before we sent INITIAL_SAMLPES+1 1975 /* Countdown: we never sync before we sent INITIAL_SAMPLES+1
1976 * packets to each peer. 1976 * packets to each peer.
1977 * NB: if some peer is not responding, we may end up sending 1977 * NB: if some peer is not responding, we may end up sending
1978 * fewer packets to it and more to other peers. 1978 * fewer packets to it and more to other peers.
1979 * NB2: sync usually happens using INITIAL_SAMLPES packets, 1979 * NB2: sync usually happens using INITIAL_SAMPLES packets,
1980 * since last reply does not come back instantaneously. 1980 * since last reply does not come back instantaneously.
1981 */ 1981 */
1982 cnt = G.peer_cnt * (INITIAL_SAMLPES + 1); 1982 cnt = G.peer_cnt * (INITIAL_SAMPLES + 1);
1983 1983
1984 while (!bb_got_signal) { 1984 while (!bb_got_signal) {
1985 llist_t *item; 1985 llist_t *item;