Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions source/core/wifi_ctrl_webconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1861,6 +1861,33 @@ static int remove_all_mac_acl_entries_from_cache_and_db(rdk_wifi_vap_info_t *cur
return RETURN_OK;
}

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 < getNumberRadios(); radio_index++) {
for (vap_index = 0; vap_index < getNumberVAPsPerRadio(radio_index); 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];
Comment on lines +1871 to +1874

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;
}
}
}

int webconfig_hal_mac_filter_apply(wifi_ctrl_t *ctrl, webconfig_subdoc_decoded_data_t *data, webconfig_subdoc_type_t subdoc_type)
{
unsigned int radio_index, vap_index;
Expand All @@ -1887,8 +1914,8 @@ int webconfig_hal_mac_filter_apply(wifi_ctrl_t *ctrl, webconfig_subdoc_decoded_d
}

if (new_config->acl_map == current_config->acl_map) {
wifi_util_dbg_print(WIFI_MGR,"%s %d Same data returning \n", __func__, __LINE__);
return RETURN_OK;
wifi_util_dbg_print(WIFI_MGR,"%s %d Same data %d, skipping \n", __func__, __LINE__, vap_index);
continue;
Comment thread
navyasher marked this conversation as resolved.
}

if ((subdoc_type == webconfig_subdoc_type_mesh) && (isVapMeshBackhaul(data->radios[radio_index].vaps.rdk_vap_array[vap_index].vap_index)) == FALSE) {
Expand Down Expand Up @@ -1979,18 +2006,8 @@ int webconfig_hal_mac_filter_apply(wifi_ctrl_t *ctrl, webconfig_subdoc_decoded_d
}
}

if ((new_config != NULL) && (new_config->acl_map != NULL)) {
new_acl_entry = hash_map_get_first(new_config->acl_map);
while (new_acl_entry != NULL) {
to_mac_str(new_acl_entry->mac,new_mac_str);
new_acl_entry = hash_map_get_next(new_config->acl_map,new_acl_entry);
temp_acl_entry = hash_map_remove(new_config->acl_map, new_mac_str);
if (temp_acl_entry != NULL) {
free(temp_acl_entry);
}
}
hash_map_destroy(new_config->acl_map);
}
/* Free all decoded ACL maps that are not aliased to the mgr's live cache */
destroy_non_aliased_acl_maps(data);
return ret;
}

Expand Down
Loading