mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 06:28:05 +02:00
iwd: Don't start new secret request if we sent one already
When IWD asks us for a secret check that we're in NM_DEVICE_STATE_CONFIG and not for example already in NM_DEVICE_STATE_NEED_AUTH. I believe that should only happen if IWD is aborting the previous connection attempt and connecting to a different network due to a timeout or due to somebody outside NM calling Connect() on an IWD network object... Guessing what IWD is doing this way is a bit fragile in the long term but we have to do that as long as we want to override IWD's internal autoconnect, which I guess we may be able to stop doing at some point.
This commit is contained in:
parent
61e4b5a230
commit
3b6c5d5839
1 changed files with 8 additions and 6 deletions
|
|
@ -2501,7 +2501,8 @@ error:
|
|||
gboolean
|
||||
nm_device_iwd_agent_query(NMDeviceIwd *self, GDBusMethodInvocation *invocation)
|
||||
{
|
||||
NMDeviceIwdPrivate * priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceIwdPrivate * priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMActRequest * req;
|
||||
const char * setting_name;
|
||||
const char * setting_key;
|
||||
|
|
@ -2509,9 +2510,12 @@ nm_device_iwd_agent_query(NMDeviceIwd *self, GDBusMethodInvocation *invocation)
|
|||
NMSecretAgentGetSecretsFlags get_secret_flags =
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION;
|
||||
|
||||
req = nm_device_get_act_request(NM_DEVICE(self));
|
||||
if (!req)
|
||||
req = nm_device_get_act_request(device);
|
||||
if (!req || nm_device_get_state(device) != NM_DEVICE_STATE_CONFIG) {
|
||||
_LOGI(LOGD_WIFI, "IWD asked for secrets without explicit connect request");
|
||||
send_disconnect(self);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!try_reply_agent_request(self,
|
||||
nm_act_request_get_applied_connection(req),
|
||||
|
|
@ -2537,9 +2541,7 @@ nm_device_iwd_agent_query(NMDeviceIwd *self, GDBusMethodInvocation *invocation)
|
|||
if (nm_settings_connection_get_timestamp(nm_act_request_get_settings_connection(req), NULL))
|
||||
get_secret_flags |= NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW;
|
||||
|
||||
nm_device_state_changed(NM_DEVICE(self),
|
||||
NM_DEVICE_STATE_NEED_AUTH,
|
||||
NM_DEVICE_STATE_REASON_NO_SECRETS);
|
||||
nm_device_state_changed(device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NO_SECRETS);
|
||||
wifi_secrets_get_one(self, setting_name, get_secret_flags, setting_key, invocation);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue