From: Miroslav Lichvar Date: Mon, 8 Jun 2015 15:22:01 +0000 (+0200) Subject: smooth: fix resetting X-Git-Tag: 2.1-pre1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43116be1224bd48316e37525dfd438a3b77a93e4;p=thirdparty%2Fchrony.git smooth: fix resetting --- diff --git a/smooth.c b/smooth.c index e5c60f4e..519b2ba2 100644 --- a/smooth.c +++ b/smooth.c @@ -266,13 +266,17 @@ SMT_GetOffset(struct timeval *now) void SMT_Reset(struct timeval *now) { + int i; + if (!enabled) return; - locked = 1; smooth_offset = 0.0; smooth_freq = 0.0; last_update = *now; + + for (i = 0; i < NUM_STAGES; i++) + stages[i].wander = stages[i].length = 0.0; } void