* [PATCH v2] agent: call back even if agent disconnects
@ 2021-04-09 16:37 James Prestwood
2021-04-09 16:37 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2021-04-09 16:37 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]
It was found that if the user cancels/disconnects the agent prior to
entering credentials, IWD would get stuck and could no longer accept
any connect calls with the error "Operation already in progress".
For example exiting iwctl in the Password prompt would cause this:
iwctl
$ station wlan0 connect myssid
$ Password: <Ctrl-C>
This was due to the agent never calling the network callback in the
case of an agent disconnect. Network would wait indefinitely for the
credentials, and disallow any future connect attempts.
To fix this agent_finalize_pending can be called in agent_disconnect
with a NULL reply which behaves the same as if there was an
internal timeout and ultimately allows network to fail the connection
---
src/agent.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/agent.c b/src/agent.c
index 101eaffd..5e40e1a7 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -525,6 +525,9 @@ static void agent_disconnect(struct l_dbus *dbus, void *user_data)
l_debug("agent %s disconnected", agent->owner);
+ if (agent->pending_id)
+ agent_finalize_pending(agent, NULL);
+
l_queue_remove(agents, agent);
l_idle_oneshot(agent_free, agent, NULL);
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] agent: call back even if agent disconnects
2021-04-09 16:37 [PATCH v2] agent: call back even if agent disconnects James Prestwood
@ 2021-04-09 16:37 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-04-09 16:37 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 941 bytes --]
Hi James,
On 4/9/21 11:37 AM, James Prestwood wrote:
> It was found that if the user cancels/disconnects the agent prior to
> entering credentials, IWD would get stuck and could no longer accept
> any connect calls with the error "Operation already in progress".
> For example exiting iwctl in the Password prompt would cause this:
>
> iwctl
> $ station wlan0 connect myssid
> $ Password: <Ctrl-C>
>
> This was due to the agent never calling the network callback in the
> case of an agent disconnect. Network would wait indefinitely for the
> credentials, and disallow any future connect attempts.
>
> To fix this agent_finalize_pending can be called in agent_disconnect
> with a NULL reply which behaves the same as if there was an
> internal timeout and ultimately allows network to fail the connection
> ---
> src/agent.c | 3 +++
> 1 file changed, 3 insertions(+)
>
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-09 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-09 16:37 [PATCH v2] agent: call back even if agent disconnects James Prestwood
2021-04-09 16:37 ` Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox