From: Miroslav Lichvar Date: Thu, 12 Nov 2009 11:40:45 +0000 (+0100) Subject: Don't set NTP source as reachable when reply doesn't have valid data X-Git-Tag: 1.24-pre1~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e88af337cd6a94c8c2dc3f102d5c102870534983;p=thirdparty%2Fchrony.git Don't set NTP source as reachable when reply doesn't have valid data This fixes using uninitialized sourcestats values when selecting source. --- diff --git a/ntp_core.c b/ntp_core.c index 66434ad6..566389b2 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -1071,7 +1071,7 @@ receive_packet(NTP_Packet *message, struct timeval *now, NCR_Instance inst, int LOG(LOGS_INFO, LOGF_NtpCore, "kod_rate=%d valid_kod=%d", kod_rate, valid_kod); #endif - if (valid_header) { + if (valid_header && valid_data) { inst->tx_count = 0; SRC_SetReachable(inst->source); }