uint32_t ef_type;
int n, sel_option;
+ src->family = IPADDR_UNSPEC;
src->port = SRC_DEFAULT_PORT;
src->params.minpoll = SRC_DEFAULT_MINPOLL;
src->params.maxpoll = SRC_DEFAULT_MAXPOLL;
} else if (!strcasecmp(cmd, "filter")) {
if (sscanf(line, "%d%n", &src->params.filter_length, &n) != 1)
return 0;
+ } else if (!strcasecmp(cmd, "ipv4")) {
+ src->family = IPADDR_INET4;
+ } else if (!strcasecmp(cmd, "ipv6")) {
+ src->family = IPADDR_INET6;
} else if (!strcasecmp(cmd, "maxdelay")) {
if (sscanf(line, "%lf%n", &src->params.max_delay, &n) != 1)
return 0;
return d;
if ((d = (int)sa->pool - (int)sb->pool) != 0)
return d;
+ if ((d = (int)sa->params.family - (int)sb->params.family) != 0)
+ return d;
if ((d = (int)sa->params.port - (int)sb->params.port) != 0)
return d;
return memcmp(&sa->params.params, &sb->params.params, sizeof (sa->params.params));
/* Add new sources */
if (pass == 1 && d > 0) {
source = &new_sources[j];
- s = NSR_AddSourceByName(source->params.name, IPADDR_UNSPEC, source->params.port,
+ s = NSR_AddSourceByName(source->params.name, source->params.family, source->params.port,
source->pool, source->type, &source->params.params,
&new_ids[j]);
for (i = 0; i < ARR_GetSize(ntp_sources); i++) {
source = (NTP_Source *)ARR_GetElement(ntp_sources, i);
- s = NSR_AddSourceByName(source->params.name, IPADDR_UNSPEC, source->params.port,
+ s = NSR_AddSourceByName(source->params.name, source->params.family, source->params.port,
source->pool, source->type, &source->params.params, NULL);
if (s != NSR_Success && s != NSR_UnresolvedName)
LOG(LOGS_ERR, "Could not add source %s", source->params.name);
timestamps (enabled by the <<hwtimestamp,*hwtimestamp*>> directive). This
field should be enabled only for servers known to be running *chronyd* version
4.5 or later.
+*ipv4*:::
+*ipv6*:::
+These options force *chronyd* to use only IPv4 or IPv6 addresses respectively
+for this source. They do not override the *-4* or *-6* option on the *chronyd*
+command line.
+
{blank}:::
[[pool]]*pool* _name_ [_option_]...::