RDKB-65853 - #1264
Open
navyasher wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the MAC filter webconfig apply path to avoid prematurely exiting when a decoded acl_map is pointer-aliased to the live manager cache, and to better manage decoded ACL map lifetime at the end of apply.
Changes:
- Added
destroy_non_aliased_acl_maps()to free decoded ACL maps that are not pointer-aliased to the manager’s liveacl_map. - Changed “same data” handling from
returntocontinueso one aliased VAP does not prevent other VAPs from being processed. - Replaced the prior end-of-function cleanup (which only handled the last
new_config) with a full sweep cleanup call.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
navyasher
force-pushed
the
Manish_cov3
branch
2 times, most recently
from
July 15, 2026 06:20
2c5b6f8 to
0d36f72
Compare
Comment on lines
+1864
to
+1888
| static void destroy_non_aliased_acl_maps(webconfig_subdoc_decoded_data_t *data) | ||
| { | ||
| unsigned int radio_index, vap_index; | ||
| wifi_mgr_t *mgr = get_wifimgr_obj(); | ||
| rdk_wifi_vap_info_t *decoded_vap; | ||
| rdk_wifi_vap_info_t *mgr_vap; | ||
|
|
||
| for (radio_index = 0; radio_index < data->num_radios; radio_index++) { | ||
| for (vap_index = 0; vap_index < data->radios[radio_index].vaps.num_vaps; vap_index++) { | ||
| decoded_vap = &data->radios[radio_index].vaps.rdk_vap_array[vap_index]; | ||
| mgr_vap = &mgr->radio_config[radio_index].vaps.rdk_vap_array[vap_index]; | ||
|
|
||
| if (decoded_vap->acl_map == NULL) { | ||
| continue; | ||
| } | ||
| /* Skip aliased maps — the mgr owns these */ | ||
| if (decoded_vap->acl_map == mgr_vap->acl_map) { | ||
| continue; | ||
| } | ||
|
|
||
| /* hash_map_destroy frees all keys and values internally */ | ||
| hash_map_destroy(decoded_vap->acl_map); | ||
| decoded_vap->acl_map = NULL; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
source/core/wifi_ctrl_webconfig.c:1868
webconfig_free_decoded_acl_maps()iterates usinggetNumberRadios()/getNumberVAPsPerRadio(), but the decoded payload carries its own bounds (decoded->num_radiosanddecoded->radios[r].vaps.num_vaps). Using the global counts here can walk entries that were never initialized/decoded (e.g., if a subdoc is partial), which risks destroying an invalidacl_mappointer and/or needlessly traversing unrelated VAPs. This file already uses the decoded counts in other cleanup loops (e.g.,wifi_ctrl_webconfig.c:321-324). Also, since this helper is only used in this TU, it should bestaticto avoid exporting a new global symbol.
void webconfig_free_decoded_acl_maps(webconfig_subdoc_decoded_data_t *decoded)
{
unsigned int r, v;
wifi_mgr_t *mgr = get_wifimgr_obj();
rdk_wifi_vap_info_t *dec_vap, *mgr_vap;
Reason for change: Fixing coverity issues. Test Procedure: Build should be successful and the regression test should also succeed Risks: Low Priority: P1 Signed-off-by: Navya_Sheregar@comcast.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.