On Wed, 5 Nov 2014 23:42:33 +0100, Richard Cochran wrote: > 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 <[email protected]> > --- > 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;
With this, we're calling clock_reinit for the MASTER state even when it did not change. The bug here is missing check for new_state == 0. I'll send a patch. Thanks, Jiri -- Jiri Benc ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk _______________________________________________ Linuxptp-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
