The reconfigure function unnecessarily clears the 'new_state' variable. On the second and subsequent calls, this zero value incorrectly clobbers the state of any port whose state has *not* changed.
If, for example, a port in the MASTER state goes FAULTY, when it returns to MASTER state, phc2sys will not synchronize it, because the SLAVE port's state variable will have been cleared to zero, effectively erasing the local time source. This patch fixes the issue by removing the assignment. Signed-off-by: Richard Cochran <richardcoch...@gmail.com> --- phc2sys.c | 1 - 1 file changed, 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index 22eb9c9..47ee3b8 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -309,7 +309,6 @@ static void reconfigure(struct node *node) clock_reinit(c); c->state = c->new_state; - c->new_state = 0; if (c->state == PS_SLAVE) { src = c; -- 1.7.10.4 ------------------------------------------------------------------------------ _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel