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 09/11] service: Change IPv6 support if split routing value 
changes on IPv4 VPN
      (Daniel Wagner)
   2. RE: Online check down on IPV4 leading to a full production park crash
      (VAUTRIN Emmanuel (Canal Plus Prestataire))
   3. [PATCH v3 1/6] service: Remove unused __connman_service_disconnect_all()
      (Daniel Wagner)
   4. [PATCH v3 0/6]  Teach autoconnect algorithm native mode
      (Daniel Wagner)
   5. [PATCH v3 2/6] service: Factor autoconnect trigger code into a new 
function
      (Daniel Wagner)
   6. [PATCH v3 3/6] iwd: Init AutoConnect of know networks
      (Daniel Wagner)
   7. [PATCH v3 4/6] iwd: Filter out connect failure for autoconnect
      (Daniel Wagner)


----------------------------------------------------------------------

Date: Mon, 12 Apr 2021 11:11:59 +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: David Woodhouse <dw...@infradead.org>
Cc: connman@lists.01.org
Message-ID: <20210412091159.5joym3ut2pqr2...@beryllium.lan>
Content-Type: text/plain; charset=us-ascii

On Fri, Apr 09, 2021 at 02:05:44PM +0100, David Woodhouse wrote:
> Let me know if you need anything more.

Thanks for the instructions! I'll start soon on this project. Just need
to finish the pending patches.

------------------------------

Date: Mon, 12 Apr 2021 09:25:40 +0000
From: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
        <emmanuel.vaut...@cpexterne.org>
Subject: RE: Online check down on IPV4 leading to a full production
        park crash
To: Jussi Laakkonen <jussi.laakko...@jolla.com>, Daniel Wagner
        <w...@monom.org>
Cc: "connman@lists.01.org" <connman@lists.01.org>
Message-ID:  <pr1pr02mb47949577e36e7390dbe30adc93...@pr1pr02mb4794.eur
        prd02.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"

Thank you,

I will check that.


B.R.

Emmanuel

------------------------------

Date: Mon, 12 Apr 2021 21:58:40 +0200
From: Daniel Wagner <w...@monom.org>
Subject: [PATCH v3 1/6] service: Remove unused
        __connman_service_disconnect_all()
To: connman@lists.01.org
Cc: KeithG <ys3al...@gmail.com>, Daniel Wagner <w...@monom.org>
Message-ID: <20210412195845.6394-2-w...@monom.org>

There is no user for this function. Remove it.
---
 src/connman.h |  1 -
 src/service.c | 30 ------------------------------
 2 files changed, 31 deletions(-)

diff --git a/src/connman.h b/src/connman.h
index 898174cbfc03..35dae6223a50 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -749,7 +749,6 @@ int __connman_service_indicate_default(struct 
connman_service *service);
 int __connman_service_connect(struct connman_service *service,
                        enum connman_service_connect_reason reason);
 int __connman_service_disconnect(struct connman_service *service);
-int __connman_service_disconnect_all(void);
 void __connman_service_set_active_session(bool enable, GSList *list);
 void __connman_service_auto_connect(enum connman_service_connect_reason 
reason);
 bool __connman_service_remove(struct connman_service *service);
diff --git a/src/service.c b/src/service.c
index 7dfa89f23164..30f5f64915c6 100644
--- a/src/service.c
+++ b/src/service.c
@@ -6810,36 +6810,6 @@ int __connman_service_disconnect(struct connman_service 
*service)
        return err;
 }
 
-int __connman_service_disconnect_all(void)
-{
-       struct connman_service *service;
-       GSList *services = NULL, *list;
-       GList *iter;
-
-       DBG("");
-
-       for (iter = service_list; iter; iter = iter->next) {
-               service = iter->data;
-
-               if (!is_connected(service->state))
-                       break;
-
-               services = g_slist_prepend(services, service);
-       }
-
-       for (list = services; list; list = list->next) {
-               struct connman_service *service = list->data;
-
-               service->ignore = true;
-
-               __connman_service_disconnect(service);
-       }
-
-       g_slist_free(services);
-
-       return 0;
-}
-
 /**
  * lookup_by_identifier:
  * @identifier: service identifier
-- 
2.31.1

------------------------------

Date: Mon, 12 Apr 2021 21:58:39 +0200
From: Daniel Wagner <w...@monom.org>
Subject: [PATCH v3 0/6]  Teach autoconnect algorithm native mode
To: connman@lists.01.org
Cc: KeithG <ys3al...@gmail.com>, Daniel Wagner <w...@monom.org>
Message-ID: <20210412195845.6394-1-w...@monom.org>

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)

The iwd plugin support native autoconnect so we need to disable the
core autoconnect algorithm in this case. Only lightly tested.

I saw some corner case with iwd's autoconnect algorithm. For example
there are two network net0 and net1. Both have autoconnect set. iwd
connects to net0. Then net0 dissapears and iwd chooses to connect
net1. Now user decides to disconnect from net1. After that net0
appears again, iwd doesn't auto connect to it anymore.

Daniel Wagner (6):
  service: Remove unused __connman_service_disconnect_all()
  service: Factor autoconnect trigger code into a new function
  iwd: Init AutoConnect of know networks
  iwd: Filter out connect failure for autoconnect
  network: Add __connman_network_native_autoconnect()
  service: Teach autoconnect algorithm native mode

 include/service.h |   1 +
 plugins/iwd.c     |  28 +++++++++-
 src/connman.h     |   2 +-
 src/network.c     |   7 +++
 src/service.c     | 130 +++++++++++++++++++++++-----------------------
 5 files changed, 102 insertions(+), 66 deletions(-)

-- 
2.31.1

------------------------------

Date: Mon, 12 Apr 2021 21:58:41 +0200
From: Daniel Wagner <w...@monom.org>
Subject: [PATCH v3 2/6] service: Factor autoconnect trigger code into
        a new function
To: connman@lists.01.org
Cc: KeithG <ys3al...@gmail.com>, Daniel Wagner <w...@monom.org>
Message-ID: <20210412195845.6394-3-w...@monom.org>

Let's move the autoconnect code from __conman_service_create_network()
into it's own function. This seperates the init/setup code from the
autoconnect logic.
---
 src/service.c | 74 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 40 insertions(+), 34 deletions(-)

diff --git a/src/service.c b/src/service.c
index 30f5f64915c6..5bb7f12594ce 100644
--- a/src/service.c
+++ b/src/service.c
@@ -7337,6 +7337,45 @@ static void update_from_network(struct connman_service 
*service,
        service_list_sort();
 }
 
+static void trigger_autoconnect(struct connman_service *service)
+{
+       struct connman_device *device;
+
+       connman_network_set_autoconnect(service->network,
+                               service->favorite && service->autoconnect);
+       if (service->favorite) {
+               device = connman_network_get_device(service->network);
+               if (device && !connman_device_get_scanning(device,
+                                               CONNMAN_SERVICE_TYPE_UNKNOWN)) {
+
+                       switch (service->type) {
+                       case CONNMAN_SERVICE_TYPE_UNKNOWN:
+                       case CONNMAN_SERVICE_TYPE_SYSTEM:
+                       case CONNMAN_SERVICE_TYPE_P2P:
+                               break;
+
+                       case CONNMAN_SERVICE_TYPE_GADGET:
+                       case CONNMAN_SERVICE_TYPE_ETHERNET:
+                               if (service->autoconnect) {
+                                       __connman_service_connect(service,
+                                               
CONNMAN_SERVICE_CONNECT_REASON_AUTO);
+                                       break;
+                               }
+
+                               /* fall through */
+                       case CONNMAN_SERVICE_TYPE_BLUETOOTH:
+                       case CONNMAN_SERVICE_TYPE_GPS:
+                       case CONNMAN_SERVICE_TYPE_VPN:
+                       case CONNMAN_SERVICE_TYPE_WIFI:
+                       case CONNMAN_SERVICE_TYPE_CELLULAR:
+                               do_auto_connect(service,
+                                       CONNMAN_SERVICE_CONNECT_REASON_AUTO);
+                               break;
+                       }
+               }
+       }
+}
+
 /**
  * __connman_service_create_from_network:
  * @network: network structure
@@ -7346,7 +7385,6 @@ static void update_from_network(struct connman_service 
*service,
 struct connman_service * __connman_service_create_from_network(struct 
connman_network *network)
 {
        struct connman_service *service;
-       struct connman_device *device;
        const char *ident, *group;
        char *name;
        unsigned int *auto_connect_types, *favorite_types;
@@ -7420,39 +7458,7 @@ struct connman_service * 
__connman_service_create_from_network(struct connman_ne
        service_register(service);
        service_schedule_added(service);
 
-       connman_network_set_autoconnect(network,
-                               service->favorite && service->autoconnect);
-       if (service->favorite) {
-               device = connman_network_get_device(service->network);
-               if (device && !connman_device_get_scanning(device,
-                                               CONNMAN_SERVICE_TYPE_UNKNOWN)) {
-
-                       switch (service->type) {
-                       case CONNMAN_SERVICE_TYPE_UNKNOWN:
-                       case CONNMAN_SERVICE_TYPE_SYSTEM:
-                       case CONNMAN_SERVICE_TYPE_P2P:
-                               break;
-
-                       case CONNMAN_SERVICE_TYPE_GADGET:
-                       case CONNMAN_SERVICE_TYPE_ETHERNET:
-                               if (service->autoconnect) {
-                                       __connman_service_connect(service,
-                                               
CONNMAN_SERVICE_CONNECT_REASON_AUTO);
-                                       break;
-                               }
-
-                               /* fall through */
-                       case CONNMAN_SERVICE_TYPE_BLUETOOTH:
-                       case CONNMAN_SERVICE_TYPE_GPS:
-                       case CONNMAN_SERVICE_TYPE_VPN:
-                       case CONNMAN_SERVICE_TYPE_WIFI:
-                       case CONNMAN_SERVICE_TYPE_CELLULAR:
-                               do_auto_connect(service,
-                                       CONNMAN_SERVICE_CONNECT_REASON_AUTO);
-                               break;
-                       }
-               }
-       }
+       trigger_autoconnect(service);
 
        __connman_notifier_service_add(service, service->name);
 
-- 
2.31.1

------------------------------

Date: Mon, 12 Apr 2021 21:58:42 +0200
From: Daniel Wagner <w...@monom.org>
Subject: [PATCH v3 3/6] iwd: Init AutoConnect of know networks
To: connman@lists.01.org
Cc: KeithG <ys3al...@gmail.com>, Daniel Wagner <w...@monom.org>
Message-ID: <20210412195845.6394-4-w...@monom.org>

When creating a new know network object, check if we have already a
registered network object with the autoconnect flag. If we find one,
update the value of the known network object.

During the initial D-Bus API discovering, ConnMan will create the
network objects first. This means the core will see the new network
and will try to use iwd's auto connect mode. Also ConnMan will set the
AutoConnect flag for the (ConnMan's) known networks. At this point
though, the plugin has not yet discovered the known networks object
from the D-Bus API. Thus, the initial AutoConnect value could be lost.
In theory this is not necessary but it is possible that ConnMan's
state and iwd state do not match, e.g. the user has disabled the
autoconnect via iwdctl.

This can lead to the situation where ConnMan thinks the AutoConnect
flag has been set but it is not and hence iwd's auto connect is not
enabled and hence autoconnect.
---
 plugins/iwd.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/plugins/iwd.c b/plugins/iwd.c
index 0a25fabf856d..d5c1f88b8658 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -1653,6 +1653,30 @@ static void known_network_property_change(GDBusProxy 
*proxy, const char *name,
        }
 }
 
+static void init_auto_connect(struct iwd_known_network *iwdkn)
+{
+       GHashTableIter iter;
+       gpointer key, value;
+
+       g_hash_table_iter_init(&iter, networks);
+
+       while (g_hash_table_iter_next(&iter, &key, &value)) {
+               struct iwd_network *iwdn = value;
+               struct iwd_known_network *kn;
+
+               if (!iwdn->known_network)
+                       continue;
+
+               kn = g_hash_table_lookup(known_networks, iwdn->known_network);
+               if (iwdkn != kn)
+                       continue;
+
+               iwdkn->autoconnect = iwdn->autoconnect;
+               update_auto_connect(iwdkn);
+               return;
+       }
+}
+
 static void create_know_network(GDBusProxy *proxy)
 {
        const char *path = g_dbus_proxy_get_path(proxy);
@@ -1686,6 +1710,8 @@ static void create_know_network(GDBusProxy *proxy)
                iwdkn->name, iwdkn->type, iwdkn->hidden,
                iwdkn->last_connected_time, iwdkn->auto_connect);
 
+       init_auto_connect(iwdkn);
+
        g_dbus_proxy_set_property_watch(iwdkn->proxy,
                        known_network_property_change, NULL);
 }
-- 
2.31.1

------------------------------

Date: Mon, 12 Apr 2021 21:58:43 +0200
From: Daniel Wagner <w...@monom.org>
Subject: [PATCH v3 4/6] iwd: Filter out connect failure for
        autoconnect
To: connman@lists.01.org
Cc: KeithG <ys3al...@gmail.com>, Daniel Wagner <w...@monom.org>
Message-ID: <20210412195845.6394-5-w...@monom.org>

If the user ask explicitly to connect to a network and the operations
fails for any reason the ConnMan core will go from either idle or
connected to failure state. In failure state the core will call
connman_network_disconnect() which will be propagated to iwd.  This
disables the autoconnect modus of iwd.

So the simplest thing here is not to tell the core the connect fails,
instead just don't do anything, this keeps the autoconnect of iwd
working and ConnMan's state machine doesn't need this either.
---
 plugins/iwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/iwd.c b/plugins/iwd.c
index d5c1f88b8658..4ba107f3e113 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -249,7 +249,7 @@ static void cm_network_connect_cb(DBusMessage *message, 
void *user_data)
                if (!strcmp(dbus_error, "net.connman.iwd.Failed"))
                        connman_network_set_error(iwdn->network,
                                        CONNMAN_NETWORK_ERROR_INVALID_KEY);
-               else
+               else if (!iwdn->autoconnect)
                        connman_network_set_error(iwdn->network,
                                        CONNMAN_NETWORK_ERROR_CONNECT_FAIL);
                return;
-- 
2.31.1

------------------------------

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 23
***************************************

Reply via email to