mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 12:52:49 +01:00
network: add check for autoconnect flag in settings
This commit is contained in:
parent
91b6efaf66
commit
3230cee2a1
@ -373,6 +373,7 @@ void network_sync_psk(struct network *network)
|
||||
int network_autoconnect(struct network *network, struct scan_bss *bss)
|
||||
{
|
||||
struct wiphy *wiphy = device_get_wiphy(network->device);
|
||||
bool is_autoconnectable;
|
||||
|
||||
switch (network_get_security(network)) {
|
||||
case SECURITY_NONE:
|
||||
@ -425,6 +426,16 @@ int network_autoconnect(struct network *network, struct scan_bss *bss)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
if (!l_settings_get_bool(network->settings, "Settings",
|
||||
"Autoconnect", &is_autoconnectable))
|
||||
goto connect;
|
||||
|
||||
if (!is_autoconnectable) {
|
||||
network_settings_close(network);
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
connect:
|
||||
device_connect_network(network->device, network, bss, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user