3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-21 20:12:37 +01:00

network: Check for duplicates in network_seen

It looks like with multiple netdev seeing the same networks we'd create
multiple network_info structures for each network.  Since the
"networks" list (of network_info structs) is global that's probbaly not
the intention here.
This commit is contained in:
Andrew Zaborowski 2016-05-28 05:27:11 +02:00 committed by Denis Kenzior
parent d53873a254
commit 2e4848673a

View File

@ -104,6 +104,15 @@ bool network_seen(uint32_t type, const char *ssid)
struct timespec mtim; struct timespec mtim;
int err; int err;
struct network_info *info; struct network_info *info;
struct network_info search;
search.type = type;
strncpy(search.ssid, ssid, 32);
search.ssid[32] = 0;
info = l_queue_find(networks, network_info_match, &search);
if (info)
return true;
switch(type) { switch(type) {
case SECURITY_PSK: case SECURITY_PSK: