Skip to content

RDKEMW-000: Fix Coverity defects (1 file) - #362

Open
rdkdevpilot wants to merge 272 commits into
developfrom
topic/RDKEMW-000
Open

rdkdevpilot wants to merge 272 commits into
developfrom
topic/RDKEMW-000

Conversation

@rdkdevpilot

Copy link
Copy Markdown

Automated Fix for Coverity Defects

Triggered by: Devika Jaladi

Fixed Files

File Line(s) CIDs Checker Types Description
plugin/NetworkManagerImplementation.cpp — 69144 PASS_BY_VALUE Big parameter passed by value

Fix Summaries

plugin/NetworkManagerImplementation.cpp

The fix correctly addresses the PASS_BY_VALUE defect by changing the parameter from pass-by-value to rvalue reference (&&). The parameter 'newCache' is moved into the cache map at line 1807, which is the appropriate use of an rvalue reference. This eliminates the unnecessary copy of the IpFamilyCache object while preserving the existing logic. The change is minimal, does not introduce any new defects, and follows the acceptable fix pattern for PASS_BY_VALUE defects involving non-trivial types.

karuna2git and others added 30 commits October 4, 2024 18:56
Reason for change: In the reported ticket, it is noticed that WiFi Plugin failed to subscribe `onAvailableSSIDs` event but didnt retry.
So when scan is called by application, the scan was success but it never posted any update as it never received `onAvailableSSIDs` event from unified networkmanager plugin
Test Procedure: As per DELIA-66411
Risks: Medium
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Reason for change: Implement RDKLogger Support to NetworkManager Plugin
Test Procedure: Verify logs are printed properly
Risks: Low
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Reason for change: Additional Changes to support RDKLogger
Test Procedure: Verify logs are printed properly
Risks: Low
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
#1)

Implemented a cache logic to handle redundant calls  
* update the review comments
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
…ate with NetworkManager (#21)

Reason for change: Use ComRPC in Network and WiFi Plugin to communicate with NetworkManager
Test Procedure: Perform all the Network and Wifi JSONRPC requests n confirm
Risks: High
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
…gs (#23)

Reason for change: Fixed the empty interface being returned in GetIPSettings
Test Procedure: as per DELIA-66721
Risks: Low
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Reason for change: Fixed the empty IPAddress in onIPAddressChange Event
Test Procedure: as per DELIA-66775 
Risks: Medium
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
* Added support for start WPS

* Added support for start WPS
Reason for change: Check the empty interface & ipversion input
Test Procedure: Call org.rdk.NetworkManager.GetIPSettings with no input param
Risks: Medium
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
* Implemented Test Class for wifisiganlstrength monitor class
* Update CMakeLists.txt to include the unittest folder
* Update gnome_unit_test.yml to upload the code coverage report
---------

Co-authored-by: Karunakaran A <48997923+karuna2git@users.noreply.github.com>
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
…tAvailableInterfaces method (#31)

* Gnome issue fix for following api
 wifiConnect
 addtoknownssid
 removeknowssid
 getavilablessid
 getwifisiganlstrength

 GetAvailableInterfaces
 GetPrimaryInterface
 GetInterfaceState
 GetIPSettings

* onAddressChange event modified
* Posting event even if interface already connected before plugin start
* Update NetworkManagerGnomeEvents.cpp

Signed-off-by: cmuhammedrafi <muhammed_rafi@comcast.com>
…ceChanged EventData (#36)

* The onWifiSignalThresholdChanged and onDefaultInterfaceChanged events are posted with empty/null event data. Fixing it
* Updated the release version
Reason for change: GetInterfaceState is using the SetInterfaceState
networkmanager implementation call instead of GetInterfaceState call.
Modified the same.
Test Procedure: Check with curl commands
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <Gururaja_ErodeSriranganRamlingham@comcast.com>
…bled before reboot (#38)

-) set interface api updated
-) onavailable ssid sterngth renamed
-) removed unused variable
Signed-off-by: cmuhammedrafi <muhammed_rafi@comcast.com>
* DELIA-66920 - GetWiFiSignalStrength is not return actual strength

Reason for change: Removed the internal mapping and returning the actual
strength value
Test Procedure: Check with curl command
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <Gururaja_ErodeSriranganRamlingham@comcast.com>
* RDKE-352 - Modified the WPS API

Reason for change: Modified StartWPS API to use wpa_cli and wifiConnect API
call to connect with wifi using WPS
Test Procedure: Check with StartWPS curl command
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <Gururaja_ErodeSriranganRamlingham@comcast.com>
…r IARM_BUS_NETWORK_MANAGER_EVENT_INTERFACE_IPADDRESS (#42)
…ead of integer (#43)

Co-authored-by: Karunakaran A <48997923+karuna2git@users.noreply.github.com>
Release of v0.5.4
Updated Wifi State
gururaajar and others added 7 commits September 3, 2026 10:50
…ange. (#328)

* onroutechange event implementation

* Added macro to conditional compilation

* Modified the code to have separate client to get connectivity status form the connectivity plugin

* Added RFC for connectivity manager enabling in networkmanager

* Added enable of USE_RFCAPI in proper place

* updated with macro USE_CONNECTIVITYCHECKMGR

* Added the documentation

* Added Bridging of events between networkmanager and connectivity manager

* Addressed the crash issue

* To Fix the crash

* Added reason for isconnectedtointernet API

* Updated with compilation issue fix

* Added cache logic to read the internet status from connectivitymgr plugin

* Changed the reason into default instead of function overloading

* Changed connected field to return true for LIMITED_INTERNET state only when connectivitymgr plugin is in use

* Fixed compilation issue

* Addressed copilot review comments

* Addressed copilot review comments

* Added more clarity to documentation for reason. Also added copilot review comments

* Added reason to the oninternetstatuschange event

* Addressed the review comment

* Addressed copilot review comments

* Addressed review comments

* To fix L1 and L2 issue

* For rdk proxy this test is not required

* Update name of the RFC return code

Update name of the RFC return code

* Updated with review comments

* Corrected variable name

* Updated the missed change

* Added header chrono

* Fixed L1 and L2 issue

* Fixed L1 and L2 issue

* Change ConnectivityMonitor to non smart pointer to match old way

* Fixed compilation issue

* Addressed L1 test failure

* To test

* Removed unused code

* Update NetworkManagerImplementation.cpp

---------

Co-authored-by: Gururaaja E S R <Gururaja_ErodeSriranganRamlingham@comcast.com>
Co-authored-by: RAFI <103924677+cmuhammedrafi@users.noreply.github.com>
Co-authored-by: Karunakaran A <48997923+karuna2git@users.noreply.github.com>
Release of 4.0.0
Reason for change: Remove explicit rescan request upon wake-up(NSM-ON).
Test Procedure: Change the channel in AP or change the timeout for SAE GTK_REKEY when the box is in DeepSleep & wake-up; ensure WiFi reconnected with 10s; wake-up journey.
Priority: P1
Risks: Low

Signed-off-by: Devika Jaladi <djalad690@cable.comcast.com>
Co-authored-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Release of 4.1.0
…3s to 1s (#345)

* RDKEMW-23908: Reduce default ping count (3->1), timeout (3s->1s), interval (0.2s->0.002s)

Reason for change: Current Ping method is synchronous and blocks other method
calls while ping is executing. This fix is a mitigation. A proper fix requires
methods like Ping that trigger long-running operations to be asynchronous.
Test Procedure: Refer ticket
Risks: Low
Signed-off-by: Tony_Ukken2@comcast.com
Co-authored-by: Karunakaran A <48997923+karuna2git@users.noreply.github.com>
Co-authored-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com>
Release of 4.2.0
Defect ID: 6e0dbd42-72b3-4b14-a740-56f0130fd7fb
@rdkdevpilot
rdkdevpilot requested a review from a team as a code owner September 15, 2026 15:19
Copilot AI lite review requested due to automatic review settings September 15, 2026 15:19

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.

🟡 Changes recommended

The interface and callers must be updated consistently while preserving the caller’s cache data.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This pull request attempts to fix Coverity defect 69144 by changing swapIpCache to accept an rvalue reference and avoid an unnecessary copy.

Changes:

  • Changes the newCache parameter in plugin/NetworkManagerImplementation.cpp from pass-by-value to rvalue reference.
File summaries
File Review
plugin/NetworkManagerImplementation.cpp The definition no longer matches the header declaration. Updating callers requires preserving cache data to avoid suppressing IP_ACQUIRED events.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread plugin/NetworkManagerImplementation.cpp
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI review requested due to automatic review settings September 21, 2026 03:01

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.

Copilot review overview

🟡 Changes recommended

The new rvalue-only swapIpCache API breaks existing lvalue call sites (notably in tests) and the GNOME events file now uses std::move without including <utility>, risking build failures.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity · 1 Medium severity · 1 Low severity

Open (4)

Comment thread plugin/NetworkManagerImplementation.h
Comment thread plugin/gnome/NetworkManagerGnomeEvents.cpp
Comment thread plugin/NetworkManagerImplementation.cpp
Copilot AI review requested due to automatic review settings September 21, 2026 03:18

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.

Copilot review overview

🟡 Changes recommended

The updated implementation performs a potentially expensive deep copy while holding m_ipCacheMutex, increasing lock contention compared to the prior by-value + move pattern.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity · 2 Low severity

Open (4)
Resolved since last review (2)

Comment thread plugin/NetworkManagerImplementation.cpp Outdated
Comment thread plugin/NetworkManagerImplementation.h Outdated
Copilot AI review requested due to automatic review settings September 23, 2026 02:13

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.

Copilot review overview

🟢 Approval recommended

The only remaining comment is a non-blocking metadata scope nit; the code changes are narrowly scoped and reviewed.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

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.

🟡 Changes recommended

Update the pull request description and fixed-file summary to accurately reflect all modified files and functional changes.

1 open issue

Review effort: Lite

std::set<std::string> swapIpCache(const std::string& iface,
const std::string& ipFamily,
IpFamilyCache newCache);
IpFamilyCache&& newCache);
@gururaajar
gururaajar changed the base branch from topic/coverity_check to develop October 26, 2026 19:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.