Send connman mailing list submissions to connman@lists.01.org To subscribe or unsubscribe via email, send a message with subject or body 'help' to connman-requ...@lists.01.org
You can reach the person managing the list at connman-ow...@lists.01.org When replying, please edit your Subject line so it is more specific than "Re: Contents of connman digest..." Today's Topics: 1. Re: [PATCH v3 0/6] Teach autoconnect algorithm native mode (Daniel Wagner) 2. Re: [PATCH v2] Rewrite openconnect plugin to use libopenconnect (Daniel Wagner) 3. [PATCH 0/2] Open code g_memdup (Daniel Wagner) 4. [PATCH 1/2] wifi: Open code g_memdup (Daniel Wagner) 5. [PATCH 2/2] peer: Open code g_memdup (Daniel Wagner) 6. Re: [PATCH 0/2] Open code g_memdup (Daniel Wagner) 7. [PATCH] service: Prevent auto connection during passphrase request (Daniel Wagner) 8. Re: [PATCH 09/11] service: Change IPv6 support if split routing value changes on IPv4 VPN (Daniel Wagner) 9. Re: [PATCH] timeserver: Fix time update manual->auto at startup (Daniel Wagner) ---------------------------------------------------------------------- Date: Sun, 18 Apr 2021 13:00:23 +0200 From: Daniel Wagner <w...@monom.org> Subject: Re: [PATCH v3 0/6] Teach autoconnect algorithm native mode To: connman@lists.01.org Cc: KeithG <ys3al...@gmail.com> Message-ID: <20210418110023.nrbpkfe6gqzzv...@beryllium.lan> Content-Type: text/plain; charset=us-ascii On Mon, Apr 12, 2021 at 09:58:39PM +0200, Daniel Wagner wrote: > changes v3: > - service: switch to native mode only if the network support it > - iwd: filter out connect failures when autoconnect is enabled > > changes v2: > - reorder patches > - dropped the explicit connect attempt as iwd will > trigger the connect when AutoConnect is set > - make sure the AutoConnect flag is always set (during init) KeithG tested the patches and gave me feedback that they finally solve his setup with several different type of Raspberry Pis. Patches applied. ------------------------------ Date: Sun, 18 Apr 2021 13:06:00 +0200 From: Daniel Wagner <w...@monom.org> Subject: Re: [PATCH v2] Rewrite openconnect plugin to use libopenconnect To: Santtu Lakkala <santtu.lakk...@jolla.com> Cc: connman@lists.01.org Message-ID: <20210418110600.j7v2xdh4dlmnz...@beryllium.lan> Content-Type: text/plain; charset=us-ascii Hi Santtu, On Fri, Apr 09, 2021 at 09:48:16AM +0300, Santtu Lakkala wrote: > Replace most of the fork/exec and output parsing with usage of > libopenconnect for authentication. The actual connection establishment > is still done by calling the openconnect binary using the token obtained > via the use of the library. > > The library has a proprietary main loop and provides only a synchronous > API, which is worked around by using a thread to run the authentication. > Events from the library are delegated to the main thread via main loop. Patch applied. Thanks, Daniel ------------------------------ Date: Sun, 18 Apr 2021 13:46:03 +0200 From: Daniel Wagner <w...@monom.org> Subject: [PATCH 0/2] Open code g_memdup To: connman@lists.01.org Cc: Daniel Wagner <w...@monom.org> Message-ID: <20210418114605.31685-1-w...@monom.org> GLib v2.68 release from last week forces ConnMan to update the minimum version for GLib to v2.68. Ditch g_memdup instead. https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-memdup2 Daniel Wagner (2): wifi: Open code g_memdup peer: Open code g_memdup plugins/wifi.c | 25 ++++++++++++++++++------- src/peer.c | 5 ++++- 2 files changed, 22 insertions(+), 8 deletions(-) -- 2.31.1 ------------------------------ Date: Sun, 18 Apr 2021 13:46:04 +0200 From: Daniel Wagner <w...@monom.org> Subject: [PATCH 1/2] wifi: Open code g_memdup To: connman@lists.01.org Cc: Daniel Wagner <w...@monom.org> Message-ID: <20210418114605.31685-2-w...@monom.org> g_memdup got marked as depricated in favor for g_memdup2 since GLib v2.68 which is the very same version g_memdup2 was introduced. We don't want to increase the minium GLib version to latest greatest hence open code this function. --- plugins/wifi.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/plugins/wifi.c b/plugins/wifi.c index c452106e5631..10cf49e684ce 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -484,15 +484,23 @@ static GSupplicantP2PServiceParams *fill_in_peer_service_params( if (version > 0) { params->version = version; - params->service = g_memdup(spec, spec_length); + if (spec_length > 0) { + params->service = g_malloc(spec_length); + memcpy(params->service, spec, spec_length); + } } else if (query_length > 0 && spec_length > 0) { - params->query = g_memdup(query, query_length); + params->query = g_malloc(query_length); + memcpy(params->query, query, query_length); params->query_length = query_length; - params->response = g_memdup(spec, spec_length); + params->response = g_malloc(spec_length); + memcpy(params->response, spec, spec_length); params->response_length = spec_length; } else { - params->wfd_ies = g_memdup(spec, spec_length); + if (spec_length > 0) { + params->wfd_ies = g_malloc(spec_length); + memcpy(params->wfd_ies, spec, spec_length); + } params->wfd_ies_length = spec_length; } @@ -1186,11 +1194,14 @@ static int get_hidden_connections_params(struct wifi_data *wifi, scan_params->num_ssids = i; scan_params->ssids = g_slist_reverse(scan_params->ssids); - scan_params->freqs = g_memdup(orig_params->freqs, - sizeof(uint16_t) * orig_params->num_freqs); - if (!scan_params->freqs) + if (orig_params->num_freqs <= 0) goto err; + scan_params->freqs = + g_malloc(sizeof(uint16_t) * orig_params->num_freqs); + memcpy(scan_params->freqs, orig_params->freqs, + sizeof(uint16_t) *orig_params->num_freqs); + scan_params->num_freqs = orig_params->num_freqs; } else -- 2.31.1 ------------------------------ Date: Sun, 18 Apr 2021 13:46:05 +0200 From: Daniel Wagner <w...@monom.org> Subject: [PATCH 2/2] peer: Open code g_memdup To: connman@lists.01.org Cc: Daniel Wagner <w...@monom.org> Message-ID: <20210418114605.31685-3-w...@monom.org> g_memdup got marked as depricated in favor for g_memdup2 since GLib v2.68 which is the very same version g_memdup2 was introduced. We don't want to increase the minium GLib version to latest greatest hence open code this function. --- src/peer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/peer.c b/src/peer.c index c66b3a718ed2..bad5c841ce12 100644 --- a/src/peer.c +++ b/src/peer.c @@ -983,7 +983,10 @@ void connman_peer_add_service(struct connman_peer *peer, service = g_malloc0(sizeof(struct _peer_service)); service->type = type; - service->data = g_memdup(data, data_length * sizeof(unsigned char)); + if (data_length > 0) { + service->data = g_malloc(data_length * sizeof(unsigned char)); + memcpy(service->data, data, data_length * sizeof(unsigned char)); + } service->length = data_length; peer->services = g_slist_prepend(peer->services, service); -- 2.31.1 ------------------------------ Date: Sun, 18 Apr 2021 13:47:15 +0200 From: Daniel Wagner <w...@monom.org> Subject: Re: [PATCH 0/2] Open code g_memdup To: connman@lists.01.org Message-ID: <20210418114715.6i65ul2rwz4ud...@beryllium.lan> Content-Type: text/plain; charset=us-ascii On Sun, Apr 18, 2021 at 01:46:03PM +0200, Daniel Wagner wrote: > GLib v2.68 release from last week forces ConnMan to update the minimum > version for GLib to v2.68. Ditch g_memdup instead. > > https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-memdup2 Patches applied. ------------------------------ Date: Sun, 18 Apr 2021 14:29:48 +0200 From: Daniel Wagner <w...@monom.org> Subject: [PATCH] service: Prevent auto connection during passphrase request To: connman@lists.01.org Cc: "VAUTRIN Emmanuel (Canal Plus Prestataire)" <emmanuel.vaut...@cpexterne.org> Message-ID: <20210418122948.10513-1-w...@monom.org> From: "VAUTRIN Emmanuel (Canal Plus Prestataire)" <emmanuel.vaut...@cpexterne.org> 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. --- Hi Emmanuel, It seems you didn't understand my explenation, here what I think is the way to go. Just use the service pointer direcltly and remove the entry at the end. Please give it a test run. Thanks, Daniel src/service.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/service.c b/src/service.c index a16350c65ddc..1adec0890a11 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; @@ -4230,6 +4231,9 @@ static bool auto_connect_service(GList *services, continue; } + if (g_hash_table_lookup(passphrase_requested, service)) + return true; + if (service->pending || is_connecting(service->state) || is_connected(service->state)) { @@ -5842,6 +5846,8 @@ static void request_input_cb(struct connman_service *service, err = __connman_service_set_passphrase(service, passphrase); done: + g_hash_table_remove(passphrase_requested, service); + if (err >= 0) { /* We forget any previous error. */ set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN); @@ -6779,6 +6785,10 @@ int __connman_service_connect(struct connman_service *service, if (service->hidden && err != -EINPROGRESS) service->pending = pending; + if (err == -EINPROGRESS) + g_hash_table_replace(passphrase_requested, + service, service); + return err; } } @@ -7750,6 +7760,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 +7794,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.31.1 ------------------------------ Date: Sun, 18 Apr 2021 14:34:12 +0200 From: Daniel Wagner <w...@monom.org> Subject: Re: [PATCH 09/11] service: Change IPv6 support if split routing value changes on IPv4 VPN To: Jussi Laakkonen <jussi.laakko...@jolla.com> Cc: connman@lists.01.org Message-ID: <20210418123412.qfgfpsvyymi7b...@beryllium.lan> Content-Type: text/plain; charset=us-ascii Hi Jussi, On Wed, Apr 07, 2021 at 01:57:05PM +0300, Jussi Laakkonen wrote: > On 4/6/21 9:49 PM, Daniel Wagner wrote: > > On Tue, Apr 06, 2021 at 05:00:23PM +0300, Jussi Laakkonen wrote: > > > > > Just expose that facility from core ConnMan and let the VPN providers > > > > > use it as they desire. > > > > > > I actually had this in mind as a next step to have a per provider option > > > to > > > really control whether to disable IPv6 or not. Some amount of work goes to > > > that as well and I think OpenConnect and WireGuard plugins are ones that > > > are > > > capable of both v4 and v6. > > > > > > What do you Daniel say, should I try to include that per provider option > > > here or work it as later, and perhaps amend the TODO on that part? > > > > This makes sense to me. I think we shouldn't encoded the policy into > > the core itself. Probably it would be good to have the interface and > > config interface sorted out first. > > > > I was thinking a simple boolean to struct connman_provider, which is changed > via PropertyChanged signals that are listened by plugins/vpn.c and are > emitted by vpn/vpn-provider.c. That boolean then replaces the usages of > if (provider->family == AF_INET) > > and is by default set as "true" to indicate that IPv6 should be disabled. > > The value then can be changed by the a VPN using the: > vpn_provider.c:vpn_provider_set_boolean(). > > > In order to minimize changes I though this to be true by default, as I > mentioned in other mails to the list, many of the VPN plugins still use IPv4 > only. But you'd prefer future proofing more it is all the same to me to do > it just the opposite. Still, security is for me an opt-out always :). > > Or did you have something else in mind? I'm not sure if I followed the last > sentence of yours. Sorry for the confusion. My concern was mostly about the D-Bus API (naming etc). The internal stuff should then be pretty straight forward. Thanks, Daniel ------------------------------ Date: Sun, 18 Apr 2021 14:38:23 +0200 From: Daniel Wagner <w...@monom.org> Subject: Re: [PATCH] timeserver: Fix time update manual->auto at startup To: "VAUTRIN Emmanuel (Canal Plus Prestataire)" <emmanuel.vaut...@cpexterne.org> Cc: "connman@lists.01.org" <connman@lists.01.org> Message-ID: <20210418123823.p3okoq7k3aj4b...@beryllium.lan> Content-Type: text/plain; charset=us-ascii Hi Emmanuel, On Wed, Apr 07, 2021 at 05:28:50PM +0000, VAUTRIN Emmanuel (Canal Plus Prestataire) wrote: > When resetting the time synchronization, always set the associated > service, even when the timeserver list is empty, to enable future > synchronization, when switching time update from manual to auto. > --- > src/timeserver.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/timeserver.c b/src/timeserver.c > index a55f1f795a9c..9732565c25ca 100644 > --- a/src/timeserver.c > +++ b/src/timeserver.c > @@ -386,6 +386,7 @@ static void ts_reset(struct connman_service *service) > __connman_service_timeserver_changed(service, timeservers_list); > > if (!timeservers_list) { > + ts_service = service; > DBG("No timeservers set."); > return; > } This does the same thing as your last patch version. When the timerserver_list is empty the timer server sync code is supposed to be off as well. If this is not the case, it's a bug and needs to be fixed. So that's why I am saying assigning ts_service a valid service and at the same time timerservers_list is NULL is just wrong. Thanks, Daniel ------------------------------ Subject: Digest Footer _______________________________________________ connman mailing list -- connman@lists.01.org To unsubscribe send an email to connman-le...@lists.01.org ------------------------------ End of connman Digest, Vol 66, Issue 26 ***************************************