From: Miroslav Lichvar Date: Mon, 25 Oct 2021 08:23:41 +0000 (+0200) Subject: ntp: don't save timestamps if transmit_packet() failed X-Git-Tag: 4.2-pre1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=189bf9c53612998515c3f131925c95f0fcf9de52;p=thirdparty%2Fchrony.git ntp: don't save timestamps if transmit_packet() failed Don't save server RX and TX timestamp to clientlog if the transmission or authentication failed (e.g. packet is handled in ntp_signd). They will not be needed. --- diff --git a/ntp_core.c b/ntp_core.c index 27348e87..40a1f3ad 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -2146,10 +2146,11 @@ NCR_ProcessRxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a version = info.version; /* Send a reply */ - transmit_packet(my_mode, interleaved, poll, version, kod, NULL, - &message->receive_ts, &message->transmit_ts, - rx_ts, tx_ts, local_ntp_rx, NULL, remote_addr, local_addr, - message, &info); + if (!transmit_packet(my_mode, interleaved, poll, version, kod, NULL, + &message->receive_ts, &message->transmit_ts, + rx_ts, tx_ts, local_ntp_rx, NULL, remote_addr, local_addr, + message, &info)) + return; if (local_ntp_rx) CLG_SaveNtpTimestamps(local_ntp_rx, tx_ts ? &tx_ts->ts : NULL);