connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] End connection if connection failure and no agent
@ 2024-02-20 10:11 Christophe Ronco
  2024-02-20 10:11 ` [PATCH 1/1] service: " Christophe Ronco
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Ronco @ 2024-02-20 10:11 UTC (permalink / raw)
  To: connman; +Cc: Christophe Ronco

I have a modem that is not able to reactivate a context just after a disconnection (I have an error in AT+CGDCONT in this case). Some seconds later, connection is possible.

With connman 1.39, here is what happens when I disconnect and reconnect corresponding connman service:

root@klk-zcel-030030:~ # date; connmanctl disconnect cellular_206018060790006_context1; date; connmanctl connect cellular_206018060790006_context1; date
Tue Feb 20 10:00:19 UTC 2024
Disconnected cellular_206018060790006_context1
Tue Feb 20 10:00:19 UTC 2024
Error /net/connman/service/cellular_206018060790006_context1: Input/output error
Tue Feb 20 10:00:20 UTC 2024

With connman 1.41, behavior changes:

root@klk-zcel-030030:/# date; connmanctl disconnect cellular_206018060790006_context1; date; connmanctl connect cellular_206018060790006_context1; date
Tue Jan  2 15:41:31 UTC 2024
Disconnected cellular_206018060790006_context1
Tue Jan  2 15:41:31 UTC 2024
Error /net/connman/service/cellular_206018060790006_context1: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Tue Jan  2 15:43:31 UTC 2024

"connmanctl connect" lasts 2 minutes (it ends with connection timeout).
After the first unsuccessful connection attempt, nothing happens. No new context activation is asked to Ofono. During these 2 minutes, if I try to connect the service, I receive an "in progress" error. This looks like a bug to me.

Change comes from commit 8ea2d67a6e8935d06f71b1ec77a2f89d72be49eb (service: Complete only after user connection retries). service_complete is not called anymore when error is received from ofono plugin. We wait for agent to call report_error_cb. There is no agent in this case so report_error_cb is never called.

I think that service_complete should be called if there is no agent.

Christophe Ronco (1):
  service: End connection if connection failure and no agent

 src/service.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] service: End connection if connection failure and no agent
  2024-02-20 10:11 [PATCH 0/1] End connection if connection failure and no agent Christophe Ronco
@ 2024-02-20 10:11 ` Christophe Ronco
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Ronco @ 2024-02-20 10:11 UTC (permalink / raw)
  To: connman; +Cc: Christophe Ronco

Immediately call service_complete in case of connection failure and no
connman agent.
---
 src/service.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/service.c b/src/service.c
index f3e022c9..805cfca7 100644
--- a/src/service.c
+++ b/src/service.c
@@ -9189,12 +9189,14 @@ static int service_indicate_state(struct connman_service *service)
 	case CONNMAN_SERVICE_STATE_FAILURE:
 		if (service->connect_reason == CONNMAN_SERVICE_CONNECT_REASON_USER ||
 			service->connect_reason == CONNMAN_SERVICE_CONNECT_REASON_NATIVE) {
-			connman_agent_report_error(service, service->path,
+			result = connman_agent_report_error(service,
+						service->path,
 						error2string(service->error),
 						report_error_cb,
 						get_dbus_sender(service),
 						NULL);
-			goto notifier;
+			if (result == -EINPROGRESS)
+				goto notifier;
 		}
 		service_complete(service);
 		break;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-20 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 10:11 [PATCH 0/1] End connection if connection failure and no agent Christophe Ronco
2024-02-20 10:11 ` [PATCH 1/1] service: " Christophe Ronco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).