From e88af337cd6a94c8c2dc3f102d5c102870534983 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 12 Nov 2009 12:40:45 +0100 Subject: [PATCH] Don't set NTP source as reachable when reply doesn't have valid data This fixes using uninitialized sourcestats values when selecting source. --- ntp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntp_core.c b/ntp_core.c index 66434ad..566389b 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); }