Miroslav Lichvar
2017-03-24 15:19:41 UTC
When ptp4l is using multiple interfaces sharing the same clock, phc2sys
in the automatic mode should not try to synchronize them to each other.
Signed-off-by: Miroslav Lichvar <***@redhat.com>
---
phc2sys.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/phc2sys.c b/phc2sys.c
index aa4186b..4bc05a5 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -638,6 +638,10 @@ static int do_loop(struct node *node, int subscriptions)
if (!update_needed(clock))
continue;
+ /* don't try to synchronize the clock to itself */
+ if (node->master->clkid == clock->clkid)
+ continue;
+
if (clock->clkid == CLOCK_REALTIME &&
node->master->sysoff_supported) {
/* use sysoff */
in the automatic mode should not try to synchronize them to each other.
Signed-off-by: Miroslav Lichvar <***@redhat.com>
---
phc2sys.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/phc2sys.c b/phc2sys.c
index aa4186b..4bc05a5 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -638,6 +638,10 @@ static int do_loop(struct node *node, int subscriptions)
if (!update_needed(clock))
continue;
+ /* don't try to synchronize the clock to itself */
+ if (node->master->clkid == clock->clkid)
+ continue;
+
if (clock->clkid == CLOCK_REALTIME &&
node->master->sysoff_supported) {
/* use sysoff */
--
2.9.3
2.9.3