Allow ORDINARY_CLOCK (OC) as doubly attached clock according to IEC 62439-3:2016 standard.
Signed-off-by: Stephan Wurm <stephan.w...@a-eberle.de> --- ptp4l.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ptp4l.c b/ptp4l.c index c61175b..8eb0720 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -23,6 +23,7 @@ #include <string.h> #include <unistd.h> +#include "bmc.h" #include "clock.h" #include "config.h" #include "ntpshm.h" @@ -73,6 +74,7 @@ int main(int argc, char *argv[]) char *config = NULL, *req_phc = NULL, *progname; enum clock_type type = CLOCK_TYPE_ORDINARY; int c, err = -1, index, print_level; + bool dac = false; struct clock *clock = NULL; struct option *opts; struct config *cfg; @@ -203,10 +205,18 @@ int main(int argc, char *argv[]) goto out; } + if (config_get_int(cfg, NULL, "dataset_comparison") == DS_CMP_IEC62439_3) { + dac = true; + } + type = config_get_int(cfg, NULL, "clock_type"); switch (type) { case CLOCK_TYPE_ORDINARY: - if (cfg->n_interfaces > 1) { + if ((!dac && cfg->n_interfaces > 1) || + /* The IEC 62439-3 standard allows doubly attached ordinary + * clocks + */ + (dac && cfg->n_interfaces > 2)) { type = CLOCK_TYPE_BOUNDARY; } break; -- 2.34.1 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel