mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 02:05:07 -05:00
ntp: don't require previous HW TX timestamp to wait for another
Clients sockets are closed immediately after receiving valid response. Don't wait for the first early HW TX timestamp to enable waiting for late timestamps. It may take a long time or never come if the HW/driver is consistently slow. It's a chicken and egg problem. Instead, simply check if HW timestamping is enabled on at least one interface. Responses from NTP sources on other interfaces will always be saved (for 1 millisecond by default).
This commit is contained in:
@@ -35,6 +35,7 @@ static struct timespec current_time;
|
||||
static NTP_Packet req_buffer, res_buffer;
|
||||
static int req_length, res_length;
|
||||
|
||||
#define NIO_IsHwTsEnabled() 1
|
||||
#define NIO_OpenServerSocket(addr) ((addr)->ip_addr.family != IPADDR_UNSPEC ? 100 : 0)
|
||||
#define NIO_CloseServerSocket(fd) assert(fd == 100)
|
||||
#define NIO_OpenClientSocket(addr) ((addr)->ip_addr.family != IPADDR_UNSPEC ? 101 : 0)
|
||||
@@ -106,13 +107,9 @@ send_request(NCR_Instance inst, int late_hwts)
|
||||
}
|
||||
|
||||
if (late_hwts) {
|
||||
inst->had_hw_tx_timestamp = 1;
|
||||
inst->report.total_good_count++;
|
||||
} else {
|
||||
if (random() % 2)
|
||||
inst->had_hw_tx_timestamp = 0;
|
||||
else
|
||||
inst->report.total_good_count = 0;
|
||||
inst->report.total_good_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user