From 86ed2432f0ec4ec7abf124448f93668d6e04157f Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 16 Oct 2016 11:55:14 +0200 Subject: [PATCH] Fix regression in one-step configuration. We activate on-step mode based on the "time_stamping" and "twoStepFlag" configuration options. If twoStepFlag is false and HW time stamping is enabled, we upgrade the time stamping mode variable to one-step. The code that tests the options and sets the one-step mode moved from ptp4l.c into clock.c in commit 9b27664c ("clock: simplify the create method."). However, that commit inadvertently moved the test after the place where the time stamping mode is latched in a local variable. As a result, one-step mode is not activated when configured. This patch fixes the issue by keeping the local time stamping mode variable up to date during the one-step test. Signed-off-by: Richard Cochran --- clock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/clock.c b/clock.c index 0107ef2..55f3c52 100644 --- a/clock.c +++ b/clock.c @@ -898,6 +898,7 @@ struct clock *clock_create(enum clock_type type, struct config *config, "with hardware time stamping"); return NULL; case TS_HARDWARE: + timestamping = TS_ONESTEP; if (config_set_int(config, "time_stamping", TS_ONESTEP)) return NULL; break;