diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-02 01:50:16 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-02 01:50:16 +0100 |
commit | 2e36eb8f273f4542a473b71a1a5c399d729acf54 (patch) | |
tree | dd69cc61daf2e1fa425b78d2f33f358d38f27f39 /networking/ntpd.c | |
parent | d9109e3b48d2eb2eebcc433bfa4d04a653a93d9b (diff) | |
download | busybox-w32-2e36eb8f273f4542a473b71a1a5c399d729acf54.tar.gz busybox-w32-2e36eb8f273f4542a473b71a1a5c399d729acf54.tar.bz2 busybox-w32-2e36eb8f273f4542a473b71a1a5c399d729acf54.zip |
ntpd: speed up reaction to poll interval decrease
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ntpd.c')
-rw-r--r-- | networking/ntpd.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c index 5cad738c6..cabfb795a 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c | |||
@@ -1484,7 +1484,20 @@ recv_and_process_peer_pkt(peer_t *p) | |||
1484 | if (G.polladj_count < -POLLADJ_LIMIT) { | 1484 | if (G.polladj_count < -POLLADJ_LIMIT) { |
1485 | G.polladj_count = 0; | 1485 | G.polladj_count = 0; |
1486 | if (G.poll_exp > MINPOLL) { | 1486 | if (G.poll_exp > MINPOLL) { |
1487 | llist_t *item; | ||
1488 | |||
1487 | G.poll_exp--; | 1489 | G.poll_exp--; |
1490 | /* Correct p->next_action_time in each peer | ||
1491 | * which waits for sending, so that they send earlier. | ||
1492 | * Old pp->next_action_time are on the order | ||
1493 | * of t + (1 << old_poll_exp) + small_random, | ||
1494 | * we simply need to subtract ~half of that. | ||
1495 | */ | ||
1496 | for (item = G.ntp_peers; item != NULL; item = item->link) { | ||
1497 | peer_t *pp = (peer_t *) item->data; | ||
1498 | if (pp->p_fd < 0) | ||
1499 | pp->next_action_time -= (1 << G.poll_exp); | ||
1500 | } | ||
1488 | VERB3 bb_error_msg("polladj: discipline_jitter:%f --poll_exp=%d", | 1501 | VERB3 bb_error_msg("polladj: discipline_jitter:%f --poll_exp=%d", |
1489 | G.discipline_jitter, G.poll_exp); | 1502 | G.discipline_jitter, G.poll_exp); |
1490 | } | 1503 | } |