This commit is contained in:
2021-02-28 22:06:17 +01:00
parent 192fa69f68
commit 681c5d8695

View File

@ -1,5 +1,6 @@
#include <stdint.h>
#include <string.h>
#include <arpa/inet.h>
#include <networkAbstractionLayer_impl.h>
#include <logger.h>
@ -138,7 +139,7 @@ void networkSntpEngine(void *handle) {
srcAddr[0], srcAddr[1], srcAddr[2], srcAddr[3],
srcPort);
coloredMsg(LOG_BLUE, "nes, received in the %d. cycles", localHandle->retryCount);
localHandle->seconds = ((localHandle->ntpMsg.xmt >> 32) & 0x0ffffffff) - UNIX_NTP_EPOCH_DIFF;
localHandle->seconds = ntohl((localHandle->ntpMsg.xmt >> 32) & 0x0ffffffff) - UNIX_NTP_EPOCH_DIFF;
coloredMsg(LOG_BLUE, "nes, seconds: %lu", localHandle->seconds);
localHandle->sntpState = SNTP_STATE_DONE;
} else {