diff --git a/clkmgr/client/notification_msg.cpp b/clkmgr/client/notification_msg.cpp index 11c64b15..2d92ee16 100644 --- a/clkmgr/client/notification_msg.cpp +++ b/clkmgr/client/notification_msg.cpp @@ -168,8 +168,7 @@ PROCESS_MESSAGE_TYPE(ClientNotificationMessage::processMessage) client_ptp_data->gm_changed_event_count.fetch_add(1, std::memory_order_relaxed); clkmgrCurrentState.gm_changed = true; - } else - clkmgrCurrentState.gm_changed = false; + } if((eventSub & eventASCapable) && (proxy_data.as_capable != client_ptp_data->as_capable)) { client_ptp_data->as_capable = proxy_data.as_capable; diff --git a/clkmgr/client/subscribe_msg.cpp b/clkmgr/client/subscribe_msg.cpp index caec889c..f4ef6196 100644 --- a/clkmgr/client/subscribe_msg.cpp +++ b/clkmgr/client/subscribe_msg.cpp @@ -246,4 +246,7 @@ void ClientSubscribeMessage::resetClientPtpEventStruct(sessionId_t sID, client_ptp_data->synced_to_gm_event_count; eventCount.gm_changed_event_count = client_ptp_data->gm_changed_event_count; eventCount.composite_event_count = client_ptp_data->composite_event_count; + /* Reset gm_changed event if the event count is 0 */ + if(client_ptp_data->gm_changed_event_count == 0) + clkmgrCurrentState->gm_changed = false; }