mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 20:15:07 -05:00
ntp: make socket resume timeout configurable
In some cases even the new timeout of 1 millisecond is not sufficient to get all HW TX timestamps. Add a new directive to allow users to specify longer timeouts.
This commit is contained in:
13
conf.c
13
conf.c
@@ -274,6 +274,9 @@ static int no_system_cert = 0;
|
||||
/* Array of CNF_HwTsInterface */
|
||||
static ARR_Instance hwts_interfaces;
|
||||
|
||||
/* Timeout for resuming reading from sockets waiting for HW TX timestamp */
|
||||
static double hwts_timeout = 0.001;
|
||||
|
||||
/* PTP event port (disabled by default) */
|
||||
static int ptp_port = 0;
|
||||
|
||||
@@ -602,6 +605,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
|
||||
parse_string(p, &hwclock_file);
|
||||
} else if (!strcasecmp(command, "hwtimestamp")) {
|
||||
parse_hwtimestamp(p);
|
||||
} else if (!strcasecmp(command, "hwtstimeout")) {
|
||||
parse_double(p, &hwts_timeout);
|
||||
} else if (!strcasecmp(command, "include")) {
|
||||
parse_include(p);
|
||||
} else if (!strcasecmp(command, "initstepslew")) {
|
||||
@@ -2505,6 +2510,14 @@ CNF_GetHwTsInterface(unsigned int index, CNF_HwTsInterface **iface)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
double
|
||||
CNF_GetHwTsTimeout(void)
|
||||
{
|
||||
return hwts_timeout;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
CNF_GetPtpPort(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user