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:
parent
d53873a254
commit
2e4848673a
@ -104,6 +104,15 @@ bool network_seen(uint32_t type, const char *ssid)
|
||||
struct timespec mtim;
|
||||
int err;
|
||||
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) {
|
||||
case SECURITY_PSK:
|
||||
|
Loading…
Reference in New Issue
Block a user