agent: call back even if agent disconnects
PATCH v2 1/1 agent: call back even if agent disconnects
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(+)
src/agent.c +3 -0
@@ -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 );
Signature · 1 line
2.26.2
Denis Kenzior
AppliedHi James,
Quoted 13 lines · James Prestwood
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.
Quoted 7 lines
To fix this
agent_finalize_pendingcan be called inagent_disconnectwith 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