aboutsummaryrefslogtreecommitdiff
path: root/networking/ntpd.c
AgeCommit message (Collapse)Author
2014-10-05ntpd: calculate offset to jitter ratio before updating jitterMiroslav Lichvar
The offset to jitter ratio is now calculated before updating jitter to make the test more sensitive. function old new delta ntp_init 460 474 +14 update_local_clock 752 764 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 26/0) Total: 26 bytes Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-02ntpd: don't stay at short polling intervalMiroslav Lichvar
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>
2014-09-27ntpd: be less eager to use shorter poll intervalsDenys Vlasenko
* on step, poll interval drops to 8.5 mins instead of 32 seconds * on total loss of all replies (no replies from any peer for last 8 requests), also drop poll interval to 8.5 mins instead of 32 seconds * on send abd recv errors, RETRY_INTERVAL is now 32 seconds, not 5 seconds * on timing out listening to reply, instead of unconditional shortening poll interval by x4, clamp it to NOREPLY_INTERVAL (512 seconds) * if a largish offset is seen, clamp nexp poll interval to 128 seconds, not 64 seconds function old new delta clamp_pollexp_and_set_MAXSTRAT - 37 +37 recv_and_process_peer_pkt 861 869 +8 poll_interval 52 48 -4 update_local_clock 762 752 -10 ntpd_main 1063 1050 -13 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/3 up/down: 45/-27) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-24ntpd: split out poll adjusting codeMiroslav Lichvar
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-24ntpd: don't wait for good offset before disabling burst modeMiroslav Lichvar
The burst mode needs to be stopped even when no replies are received. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-07-15ntpd: add support for -I IFACEDenys Vlasenko
function old new delta packed_usage 29908 29947 +39 ntp_init 428 460 +32 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 71/0) Total: 71 bytes Signed-off-by: Nikolaus Froehlich <nikolaus@mathematik.uni-marburg.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-20ntpd: fix wrong delay value in one of the printed messagesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-19ntpd: truly ignore high delay packetDenys Vlasenko
Before this cahnge, sometimes they were used after the next packet from another peer was received, because we did updare some peer stats from high delay packet before dropping it. function old new delta recv_and_process_peer_pkt 922 966 +44 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-23ntpd: add optional support for /etc/ntp.confDenys Vlasenko
function old new delta add_peers - 98 +98 packed_usage 29470 29511 +41 ntp_init 407 428 +21 pw_encrypt 14 27 +13 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 173/0) Total: 173 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-05use [s]rand(), not [s]random()Denys Vlasenko
rand() is the most standard C library function, and on uclibc they are the same. I guess they are the same in most todays' libc... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-09htpd: trivial simplification in random interval selectionDenys Vlasenko
function old new delta poll_interval 57 52 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-20ntpd: remove now unnecessary check for IP_PKTINFO definitionDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-20ntpd: fix compilation warningsBartosz Golaszewski
GCC complained about since_last_update being set but not used. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-08ntpd: adjust last packet's recv time after a stepDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-08ntpd: speed up resyncing if our clock is seriously offDenys Vlasenko
function old new delta recv_and_process_peer_pkt 892 922 +30 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-07ntpd: do not invalidate datapoints after stepDenys Vlasenko
Used to set p->filter_datapoint[i].d_dispersion = MAXDISP and clear reachable bits, but this proved to be too agressive: after step (tested with suspinding laptop for ~30 secs), this caused all previous data to be considered invalid, making us needing to collect full ~8 datapoins per peer after step in order to start trusting them. In turn, this was making poll interval decrease even after step was done. (Poll interval decreases already before step in this scenario, because we see large offsets and end up with no good peer to select). function old new delta reset_peer_stats 157 139 -18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-04ntpd: comment out "spike detection" codeDenys Vlasenko
function old new delta update_local_clock 982 835 -147 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-04ntpd: promote log level 3 to productionDenys Vlasenko
Without it, peer selection logic is hard to debug function old new delta update_local_clock 861 982 +121 select_and_cluster 962 1065 +103 common_ping_main 1788 1821 +33 huft_build 1287 1296 +9 chpst_main 708 704 -4 INET6_resolve 127 119 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/2 up/down: 266/-12) Total: 254 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-04ntpd: let user know if spike was detectedDenys Vlasenko
function old new delta update_local_clock 861 943 +82 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-30Whitespace fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-23ntpd: set offset to 0.0 in "usync" eventDenys Vlasenko
function old new delta ntpd_main 1030 1026 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-22ntpd: set G.last_script_run even if script isn't configuredDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-22ntpd: make "unsync" code actually work.Denys Vlasenko
While at it: don't run "periodic" if interrupted by a signal. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-22ntpd: drop delay outliers; run "unsync" handler if no replies for some timeDenys Vlasenko
function old new delta ntpd_main 960 1029 +69 recv_and_process_peer_pkt 834 892 +58 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 127/0) Total: 127 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-29libbb: introduce and use strftime_[YYYYMMDD]HHMMSS()Denys Vlasenko
function old new delta strftime_fmt - 53 +53 strftime_YYYYMMDDHHMMSS - 12 +12 strftime_HHMMSS - 12 +12 human_time 44 43 -1 fmtstr_t 9 - -9 step_time 361 345 -16 watch_main 261 232 -29 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 0/3 up/down: 77/-55) Total: 22 bytes text data bss dec hex filename 919203 932 17692 937827 e4f63 busybox_old 919209 932 17692 937833 e4f69 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14ntpd: fix incorrect m_status field in outgoing packets. Closes 5120Paul Marks
When using busybox ntpd with an NTPv3 client and NTPv4 server (or vice versa), the version numbers can be incorrectly ORed together, yielding the bogus value of "NTPv7". This makes ntpd unusable with clients such as Chrony and Windows "Internet Time". This patch avoids the version mangling, by copying only the Leap Indicator bits from the server's status field. Signed-off-by: Paul Marks <paul@pmarks.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14whitespace fixes. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-12-19CONFIG_PID_FILE_PATH: new configuration option for pidfile pathsAnthony G. Basile
We set a default path for the directory where pidfiles are create when FEATURE_PIDFILE is selected. The default has no effect on applets which must specify a pidfile path on the command line to run, and it can be overridden by applets which optionally allow the user to specify the pidfile path. We also add pidfile write/remove support for klogd, ntpd and watchdog. For syslogd, we add a missing remove_pidfile() for better cleanup on daemon exit. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-07-05include sys/resource.h where neededMike Frysinger
We use functions from sys/resource.h in misc applets, but don't include the header. This breaks building with newer glibc versions, so add the include where needed. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-06-11ntpd: on time step, kill all outstanding replies from other peersDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-01ntpd: fix build failure if !NTPD_SERVER. Closes 4994Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-08ntpd: make "reply from IP" messages more uniformDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-08ntpd: drop offset averaging codeDenys Vlasenko
function old new delta filter_datapoints 475 174 -301 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-06ntpd: tweak log messages formatDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-05ntpd: fix a case when discipline_jitter = 0 if we stepDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-05ntpd: experimental code to correct frequency a bit more aggressivelyDenys Vlasenko
function old new delta update_local_clock 730 792 +62 recv_and_process_peer_pkt 850 835 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-03ntpd: fix the "are we a server" check in previous commitDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-03ntpd: avoid printing messages between send and recv. good for fast networksDenys Vlasenko
function old new delta ntpd_main 887 929 +42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-02ntpd: log clock drift with three digits after decimal pointDenys Vlasenko
+15 bytes. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-02ntpd: log jitter on update too; increase assumed clock precision x2 - to 2msDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-02-28ntpd: fix offset adjustment after step; better step printingDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-02-23ntpd: increase OPT_qq constant to not collide with -LDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05*: remove "Options:" string from help textsDenys Vlasenko
function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-16The [-Wunused-but-set-variable] warningsCristian Ionescu-Idbohrn
networking/ntpd.c:1748:19: warning: variable 'version' set but not used Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11move remaining help text from include/usage.src.hPere Orga
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-07ntpd: decrease ntpd -q "no response" timeout to 10 secDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-03whitespace fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-29whitespace cleanupDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-20ntpd: fix usage text and a typo in constant nameLeonid Lisovskiy
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-04ntpd: allow peer-less (standalone stratum 1 server) operationDenys Vlasenko
Based on patch by Jean-Christophe Dubois (jcd@tribudubois.net) function old new delta ntp_init 384 399 +15 recv_and_process_client_pkt 469 480 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>