Skip to content

RDKEMW-21048: Mutex to access m_lastConnectedSSID in NMPlugin (#339) - #344

Merged
me-ha-p merged 1 commit into
feature/RDKEMW-22842from
develop
Aug 26, 2026
Merged

RDKEMW-21048: Mutex to access m_lastConnectedSSID in NMPlugin (#339)#344
me-ha-p merged 1 commit into
feature/RDKEMW-22842from
develop

Conversation

@me-ha-p

@me-ha-p me-ha-p commented Aug 26, 2026

Copy link
Copy Markdown
Contributor
  • RDKEMW-21048: Use mutex to access m_lastConnectedSSID in NetworkManager Plugin

Reason for change: Use mutex to access m_lastConnectedSSID in NetworkManager Plugin.
Priority: P2
Test Procedure: Refer ticket
Risks: Low

Signed-off-by: Mehavarshni_Palaniswamy@comcast.com

  • Updated the logging and removed TAB

Signed-off-by: Mehavarshni_Palaniswamy@comcast.com

* RDKEMW-21048: Use mutex to access m_lastConnectedSSID in NetworkManager Plugin

Reason for change: Use mutex to access m_lastConnectedSSID in NetworkManager Plugin.
Priority: P2
Test Procedure: Refer ticket
Risks: Low

Signed-off-by: Mehavarshni_Palaniswamy@comcast.com

* Updated the logging and removed TAB

Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>

---------

Signed-off-by: Mehavarshni_Palaniswamy@comcast.com
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Copilot AI lite review requested due to automatic review settings August 26, 2026 05:21
@me-ha-p
me-ha-p requested a review from a team as a code owner August 26, 2026 05:21
wifi->activateKnownConnection(nmUtils::wlanIface(), _instance->m_lastConnectedSSID);
const string lastConnectedSSID = _instance->getLastConnectedSSID();
NMLOG_INFO("Activating connection '%s' ...", lastConnectedSSID.c_str());
wifi->activateKnownConnection(nmUtils::wlanIface(), lastConnectedSSID);
if(_instance != NULL && wifi->activateKnownConnection(nmUtils::wlanIface(), _instance->m_lastConnectedSSID))
const string lastConnectedSSID = _instance->getLastConnectedSSID();
NMLOG_WARNING("ssid is empty activating last connected ssid (%s) !", lastConnectedSSID.c_str());
if(_instance != NULL && wifi->activateKnownConnection(nmUtils::wlanIface(), lastConnectedSSID))
@me-ha-p
me-ha-p merged commit 9d73332 into feature/RDKEMW-22842 Aug 26, 2026
12 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a mutex-protected accessor API for m_lastConnectedSSID in the NetworkManager plugin to avoid concurrent access issues, and updates callers to use the new getters/setters.

Changes:

  • Added setLastConnectedSSID() / getLastConnectedSSID() with a dedicated mutex in NetworkManagerImplementation.
  • Updated WiFi monitoring and deep-sleep reconnect paths to use the new accessors.
  • Updated GNOME proxy/client code to use getLastConnectedSSID() and improved related logging.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
plugin/NetworkManagerImplementation.h Adds mutex + getter/setter for last connected SSID.
plugin/NetworkManagerImplementation.cpp Replaces direct member access with the new SSID accessor API.
plugin/gnome/NetworkManagerGnomeProxy.cpp Switches reconnection/activation logic to use getLastConnectedSSID() and updates logs.
plugin/gnome/gdbus/NetworkManagerGdbusProxy.cpp Uses getLastConnectedSSID() for empty-SSID fallback activation.
plugin/gnome/gdbus/NetworkManagerGdbusClient.cpp Uses getLastConnectedSSID() for auto-reconnect when enabling WiFi.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 816 to +820
if(ssid.ssid.empty())
{
NMLOG_WARNING("ssid is empty activating last connected ssid !");
if(_instance != NULL && wifi->activateKnownConnection(nmUtils::wlanIface(), _instance->m_lastConnectedSSID))
const string lastConnectedSSID = _instance->getLastConnectedSSID();
NMLOG_WARNING("ssid is empty activating last connected ssid (%s) !", lastConnectedSSID.c_str());
if(_instance != NULL && wifi->activateKnownConnection(nmUtils::wlanIface(), lastConnectedSSID))
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants