Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. RE: [PATCH] timeserver: Fix time update manual->auto at startup
(VAUTRIN Emmanuel (Canal Plus Prestataire))
2. RE: [PATCH] service: Prevent auto connection during passphrase request
(VAUTRIN Emmanuel (Canal Plus Prestataire))
3. Re: [PATCH] timeserver: Fix time update manual->auto at startup
(Daniel Wagner)
4. Re: [PATCH] timerserver: Fix time update manual->auto
(Daniel Wagner)
----------------------------------------------------------------------
Date: Mon, 26 Apr 2021 18:45:45 +0000
From: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
<[email protected]>
Subject: RE: [PATCH] timeserver: Fix time update manual->auto at
startup
To: Daniel Wagner <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID: <[email protected]
prd02.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi Daniel
> Ahh, stupid me.
Do not say that.
> I reproduced it (thanks for your instructions) and I
> think I found a better way to fix this. The thing I don't like at your
> patch is that it fixes it at the wrong place. I'll send out a patch
> which fixes the problem for me.
I have tested your patch by my side, excluding the first change that was
probably cosmetics,
and it seems to work fine. I let you integrate it to the master.
These are great news to finally be able to close this point!
Best Regards,
Emmanuel
------------------------------
Date: Mon, 26 Apr 2021 19:10:30 +0000
From: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
<[email protected]>
Subject: RE: [PATCH] service: Prevent auto connection during
passphrase request
To: Daniel Wagner <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID: <[email protected]
prd02.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"
Avoid concurrent associations between a user connection to a secure
service, blocked by an agent passphrase input request, and a starting
auto connection on a different service of the same interface.
This issue happens when the end-user wants to connect to a new secure
Wifi network (W2) via an interface where another Wifi network (W1) is
already connected. When doing that, the following steps happen:
1. Disconnection of current network (W1).
2. User-connection to W2, held by the passphrase request.
3. Auto-connection to a known available Wifi network (W1) succeeding.
4. User-connection to W2, reactivated by the passphrase response,
failing, as another Wifi (W1) is already connected.
In this configuration, W2 will never be able to connect.
---
src/service.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/src/service.c b/src/service.c
index 20917a8923a4..f6a4e53fe262 100644
--- a/src/service.c
+++ b/src/service.c
@@ -49,6 +49,7 @@ static DBusConnection *connection = NULL;
static GList *service_list = NULL;
static GHashTable *service_hash = NULL;
+static GHashTable *passphrase_requested = NULL;
static GSList *counter_list = NULL;
static unsigned int autoconnect_id = 0;
static unsigned int vpn_autoconnect_id = 0;
@@ -4209,6 +4210,7 @@ static bool auto_connect_service(GList *services,
bool ignore[MAX_CONNMAN_SERVICE_TYPES] = { };
bool autoconnecting = false;
GList *list;
+ int index;
DBG("preferred %d sessions %d reason %s", preferred, active_count,
reason2string(reason));
@@ -4230,6 +4232,11 @@ static bool auto_connect_service(GList *services,
continue;
}
+ index = __connman_service_get_index(service);
+ if (g_hash_table_lookup(passphrase_requested,
+ GINT_TO_POINTER(index)))
+ return true;
+
if (service->pending ||
is_connecting(service->state) ||
is_connected(service->state)) {
@@ -5780,6 +5787,7 @@ static void request_input_cb(struct connman_service
*service,
struct connman_device *device;
const char *security;
int err = 0;
+ int index;
DBG("RequestInput return, %p", service);
@@ -5842,6 +5850,10 @@ static void request_input_cb(struct connman_service
*service,
err = __connman_service_set_passphrase(service, passphrase);
done:
+ index = __connman_service_get_index(service);
+ g_hash_table_remove(passphrase_requested,
+ GINT_TO_POINTER(index));
+
if (err >= 0) {
/* We forget any previous error. */
set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
@@ -6693,6 +6705,7 @@ static int service_connect(struct connman_service
*service)
int __connman_service_connect(struct connman_service *service,
enum connman_service_connect_reason reason)
{
+ int index;
int err;
DBG("service %p state %s connect reason %s -> %s",
@@ -6779,6 +6792,13 @@ int __connman_service_connect(struct connman_service
*service,
if (service->hidden && err != -EINPROGRESS)
service->pending = pending;
+ if (err == -EINPROGRESS) {
+ index = __connman_service_get_index(service);
+ g_hash_table_replace(passphrase_requested,
+ GINT_TO_POINTER(index),
+ GINT_TO_POINTER(true));
+ }
+
return err;
}
}
@@ -7750,6 +7770,8 @@ int __connman_service_init(void)
service_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
NULL, service_free);
+ passphrase_requested = g_hash_table_new(g_direct_hash, g_direct_equal);
+
services_notify = g_new0(struct _services_notify, 1);
services_notify->remove = g_hash_table_new_full(g_str_hash,
g_str_equal, g_free, NULL);
@@ -7782,6 +7804,9 @@ void __connman_service_cleanup(void)
g_hash_table_destroy(service_hash);
service_hash = NULL;
+ g_hash_table_destroy(passphrase_requested);
+ passphrase_requested = NULL;
+
g_slist_free(counter_list);
counter_list = NULL;
--
2.25.1
------------------------------
Date: Tue, 27 Apr 2021 08:45:01 +0200
From: Daniel Wagner <[email protected]>
Subject: Re: [PATCH] timeserver: Fix time update manual->auto at
startup
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
<[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Mon, Apr 26, 2021 at 06:45:45PM +0000, VAUTRIN Emmanuel (Canal Plus
Prestataire) wrote:
> I have tested your patch by my side, excluding the first change that was
> probably cosmetics,
> and it seems to work fine. I let you integrate it to the master.
Thanks for testing. I am going to apply the patch now. And yes, the
first hunk is just cosmetic, so that the two condition look alike. My
future me will like it :)
------------------------------
Date: Tue, 27 Apr 2021 08:45:43 +0200
From: Daniel Wagner <[email protected]>
Subject: Re: [PATCH] timerserver: Fix time update manual->auto
To: [email protected]
Cc: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
<[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Sun, Apr 25, 2021 at 07:58:34PM +0200, Daniel Wagner wrote:
> __connman_timeserver_conf_update() will block the update if the
> service is not matching the current used service. In case where
> ts_service is NULL it should not block the update. This can happen
> by a manual to auto TimeUpdate settings change.
>
> Reported by Emmanuel Vautrin
Patch applied (added the additional reasoning why the first hunk is in
the change).
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]
------------------------------
End of connman Digest, Vol 66, Issue 31
***************************************