From: Linux Karlsson Date: Tue, 3 Aug 2010 21:44:21 +0000 (+0200) Subject: Moved time dependent code out of the offset calculations. X-Git-Tag: NTP_4_2_7P75~34^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba86a0707278ccaed586c441aac4d4f2accee7c6;p=thirdparty%2Fntp.git Moved time dependent code out of the offset calculations. bk: 4c588db5jFCJ8zXSffMuUF3ynnWNkQ --- diff --git a/sntp/main.c b/sntp/main.c index 90e9cc947..e5517f472 100644 --- a/sntp/main.c +++ b/sntp/main.c @@ -225,6 +225,9 @@ handle_pkt ( printf("sntp handle_pkt: Received %i bytes from %s\n", rpktl, addr_buf); } + GETTIMEOFDAY(&tv_dst, (struct timezone *)NULL); + tv_dst.tv_sec += JAN_1970; + offset_calculation(rpkt, rpktl, &tv_dst, &offset, &precision, &root_dispersion); for (digits = 0; (precision *= 10.) < 1.; ++digits) @@ -301,8 +304,6 @@ offset_calculation ( #endif /* Compute offset etc. */ - GETTIMEOFDAY(tv_dst, (struct timezone *)NULL); - tv_dst->tv_sec += JAN_1970; tmp = p_rec; L_SUB(&tmp, &p_org); LFPTOD(&tmp, t21);