Skip to content
Snippets Groups Projects
Commit abd7c5e1 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

agent_map: fix issue of multiplying entries in scanresults

parent cf416213
Branches
No related tags found
No related merge requests found
......@@ -3002,6 +3002,29 @@ static void scan_results(struct agent *a, struct tlv_ch_scan_res *p, uint32_t ra
}
}
void free_scanresults_neighbors(struct wifi_radio_element *re)
{
int i;
struct wifi_scanres_element *scanres_el;
int j;
scanres_el = re->scanlist;
if (!scanres_el)
return;
for (j = 0; j < scanres_el->num_opclass_scanned; j++) {
int k;
struct wifi_scanres_opclass_element *opclass = &scanres_el->opclass_scanlist[j];
for (k = 0; k < opclass->num_channels_scanned; k++) {
struct wifi_scanres_channel_element *ch_el = &opclass->channel_scanlist[k];
free(ch_el->nbrlist);
ch_el->num_neighbors = 0;
}
}
}
int handle_channel_scan_request(void *agent, struct cmdu_cstruct *cmdu)
{
trace("%s: --->\n", __func__);
......@@ -3032,6 +3055,8 @@ int handle_channel_scan_request(void *agent, struct cmdu_cstruct *cmdu)
char *radio_name;
wifi_object_t r_wobj = WIFI_OBJECT_INVALID;
free_scanresults_neighbors(radio);
for (i = 0; i < query->nbr_radios; i++) { // a->num_radios
radio_name = wifi_get_radio_by_mac(a, query->radio_data[i].radio_id);
if (!radio_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment