ntp_node_time: исправлен знак offset — корректировка шла в обратную сторону

ntp_time_get_us() вычитает offset (local_us - offset_us), поэтому
offset_us должен быть local_raw - peer_time, а не наоборот.
Было peer_time - local_raw → corrected = 2*local - peer (ошибка).
Стало local_raw - peer_time → corrected = peer_time (верно).
This commit is contained in:
Evgeny committed 2026-07-20 01:07:09 +03:00
1 parent fdaaa41010
commit f83efda54e
1 file changed
+1 -1
+1 -1
View File
@@ -148,7 +148,7 @@ static void ntp_node_recv_cb(struct ETCP_CONN* conn, struct ll_entry* entry) {
int was_unsynced = !ntp_time_is_synced(inst);
if (was_unsynced && sender_synced) {
inst->ntp.offset_us = msg->t_sender_us - t4;
inst->ntp.offset_us = t4 - msg->t_sender_us;
inst->ntp.synced = 1;
inst->ntp.last_sync_tb = get_time_tb();