ntpd: don't stay at short polling interval
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 2 Oct 2014 15:18:43 +0000 (17:18 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 2 Oct 2014 15:24:34 +0000 (17:24 +0200)
commitb434ce70696879aad066fff67253e44e5f5b238e
treeb29fa99983269a0ccd448d3ba8b6eba8b4dace93
parentcf76b5ce12a685b0c0a8ea53fa95cb0f0922a4f1
ntpd: don't stay at short polling interval

To avoid polling servers frequently slowly increase the interval up
to BIGPOLL when
- no replies are received from a peer
- no source can be selected
- peer claims to be unsynchronized (e.g. we are polling it too
  frequently)

When recv() returns with an error, drop code to try to continue
on network errors: I'm not convinced those cases happen in real life.

function                                             old     new   delta
recv_and_process_peer_pkt                            919     838     -81

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/ntpd.c