diff --git a/src/ntp_node_time.c b/src/ntp_node_time.c index 720ae3a3..e22f30b7 100644 --- a/src/ntp_node_time.c +++ b/src/ntp_node_time.c @@ -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();