From: Daniel Wagner <wagi@monom.org>
To: Andrei Datcu <datcuandrei@gmail.com>
Cc: connman@lists.linux.dev
Subject: Re: Clearing service error from invalid-key will not invoke the agent anymore
Date: Thu, 1 Jul 2021 08:47:39 +0200 [thread overview]
Message-ID: <20210701064739.oilpty5pd43z4cyc@beryllium.lan> (raw)
In-Reply-To: <CAAmFs7=AcOmoNWVaGEoi_9FPgh3NBS1LiceWOVQgL0xS=hnKYw@mail.gmail.com>
Hi Andrei,
On Tue, Jun 22, 2021 at 09:10:05PM +0300, Andrei Datcu wrote:
> Using version 1.40, I'm trying to connect to a basic psk wifi hotspot.
> If I input a wrong key to the agent request, the service will
> correctly get Error == "invalid-key" (and State == "idle"). Invoking
> Service::ClearProperty("Error") will put the service in a weird state:
> every subsequent Service::Connect() call will fail without ever
> requesting any agent input. To leave this state, one has to call
> `Service::Remove()`.
> Is this expected or is this a bug?
Sounds like a bug to me. I think it could be that we set the error state
but don't update the ipconfig/service state accordingly. Although you
are saying the service is in a error state.
So this here is probably not helping:
--- a/src/service.c
+++ b/src/service.c
@@ -3999,6 +3999,13 @@ static DBusMessage *clear_property(DBusConnection *conn,
if (g_str_equal(name, "Error")) {
set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
+ __connman_service_ipconfig_indicate_state(service,
+ CONNMAN_SERVICE_STATE_FAILURE,
+ CONNMAN_IPCONFIG_TYPE_IPV4);
+ __connman_service_ipconfig_indicate_state(service,
+ CONNMAN_SERVICE_STATE_FAILURE,
+ CONNMAN_IPCONFIG_TYPE_IPV6);
+
__connman_service_clear_error(service);
service_complete(service);
} else
If possible could you check what the service state is when we hit the
__connman_service_clear_error?
@@ -6183,7 +6190,7 @@ int __connman_service_clear_error(struct connman_service *service)
{
DBusMessage *pending, *provider_pending;
- DBG("service %p", service);
+ DBG("service %p state %d", service, service->state);
if (!service)
return -EINVAL;
TBH, the 'set_error' thing looks a bit strange. The commit message says
service: Signal error property changes
In order to allow clients to update the property in a manner similar to
other service properties, signal changes in the service "Error" property
key/value pair.
The value "" is used when no error is asserted because D-Bus property
changed convention has no semantics for indicating a key/value pair was
removed.
Thanks,
Daniel
prev parent reply other threads:[~2021-07-01 6:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-22 18:10 Clearing service error from invalid-key will not invoke the agent anymore Andrei Datcu
2021-06-22 18:31 ` John Keeping
2021-06-22 18:39 ` Andrei Datcu
2021-06-24 8:10 ` Daniel Wagner
2021-07-01 6:47 ` Daniel Wagner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210701064739.oilpty5pd43z4cyc@beryllium.lan \
--to=wagi@monom.org \
--cc=connman@lists.linux.dev \
--cc=datcuandrei@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).