diff --git a/clock.c b/clock.c index 459b7b9..eeefd39 100644 --- a/clock.c +++ b/clock.c @@ -402,7 +402,9 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count, if (c->nports) clock_destroy(c); - if (phc_index >= 0) { + if (c->dds.free_running) { + c->clkid = CLOCK_INVALID; + } else if (phc_index >= 0) { snprintf(phc, 31, "/dev/ptp%d", phc_index); c->clkid = phc_open(phc); if (c->clkid == CLOCK_INVALID) { diff --git a/ptp4l.c b/ptp4l.c index 12bb3f3..6fc210a 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -247,7 +247,9 @@ int main(int argc, char *argv[]) } /* determine PHC Clock index */ - if (*timestamping == TS_SOFTWARE || *timestamping == TS_LEGACY_HW) { + if (ds->free_running) { + phc_index = -1; + } else if (*timestamping == TS_SOFTWARE || *timestamping == TS_LEGACY_HW) { phc_index = -1; } else if (req_phc) { if (1 != sscanf(req_phc, "/dev/ptp%d", &phc_index)) {