The reconfigure function is missing a check whether state for the given
clock actually changed or not. This caused state for all unchanged ports to
be zeroed.

Reported-by: Richard Cochran <richardcoch...@gmail.com>
Signed-off-by: Jiri Benc <jb...@redhat.com>
---
 phc2sys.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/phc2sys.c b/phc2sys.c
index 22eb9c965ce9..67d8a588288f 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -305,11 +305,13 @@ static void reconfigure(struct node *node)
                        continue;
                }
 
-               if (c->new_state == PS_MASTER)
-                       clock_reinit(c);
+               if (c->new_state) {
+                       if (c->new_state == PS_MASTER)
+                               clock_reinit(c);
 
-               c->state = c->new_state;
-               c->new_state = 0;
+                       c->state = c->new_state;
+                       c->new_state = 0;
+               }
 
                if (c->state == PS_SLAVE) {
                        src = c;
-- 
1.8.3.1


------------------------------------------------------------------------------
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
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to