Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, 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. [PATCH v2 4/6] Revert "network: connectable flag in network
      structure" ([email protected])
   2. [PATCH v2 6/6] wifi: Set current network in case of
      reconnection ([email protected])
   3. [PATCH v2 5/6] gsupplicant: Add callback to notify the
      associated network ([email protected])
   4. [PATCH] gsupplicant/service: Ease logs reading and analysis
      ([email protected])


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

Message: 1
Date: Wed, 21 Jun 2017 15:55:06 +0000
From: [email protected]
To: [email protected]
Cc: [email protected], [email protected],
        [email protected], Jose Blanquicet
        <[email protected]>
Subject: [PATCH v2 4/6] Revert "network: connectable flag in network
        structure"
Message-ID:
        
<1498060508-20600-4-git-send-email-jose.blanquicet-melen...@magnetimarelli.com>
        

From: Jose Blanquicet <[email protected]>

This reverts commit b7d20de51c5293fc28bb840e95a11b31747f51d8.
---
 include/network.h |  5 -----
 src/network.c     | 13 -------------
 2 files changed, 18 deletions(-)

diff --git a/include/network.h b/include/network.h
index 5d44669599c8..4fc20c1c072b 100644
--- a/include/network.h
+++ b/include/network.h
@@ -103,11 +103,6 @@ bool connman_network_get_connected(struct connman_network 
*network);
 
 bool connman_network_get_associating(struct connman_network *network);
 
-bool connman_network_get_connectable(struct connman_network *network);
-
-int connman_network_set_connectable(struct connman_network *network,
-               bool connectable);
-
 void connman_network_clear_hidden(void *user_data);
 int connman_network_connect_hidden(struct connman_network *network,
                        char *identity, char* passphrase, void *user_data);
diff --git a/src/network.c b/src/network.c
index a5b7d787749b..e7107740b3a2 100644
--- a/src/network.c
+++ b/src/network.c
@@ -50,7 +50,6 @@ struct connman_network {
        bool available;
        bool connected;
        bool roaming;
-       bool connectable;
        uint8_t strength;
        uint16_t frequency;
        char *identifier;
@@ -841,18 +840,6 @@ static gint compare_priority(gconstpointer a, 
gconstpointer b)
        return driver2->priority - driver1->priority;
 }
 
-int connman_network_set_connectable(struct connman_network *network,
-               bool connectable)
-{
-       network->connectable = connectable;
-       return 0;
-}
-
-bool connman_network_get_connectable(struct connman_network *network)
-{
-       return network->connectable;
-}
-
 /**
  * connman_network_driver_register:
  * @driver: network driver definition
-- 
1.9.1



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

Message: 2
Date: Wed, 21 Jun 2017 15:55:08 +0000
From: [email protected]
To: [email protected]
Cc: [email protected], [email protected],
        [email protected], Jose Blanquicet
        <[email protected]>
Subject: [PATCH v2 6/6] wifi: Set current network in case of
        reconnection
Message-ID:
        
<1498060508-20600-6-git-send-email-jose.blanquicet-melen...@magnetimarelli.com>
        

From: Jose Blanquicet <[email protected]>

Use associated notification from gsupplicant to ensure ConnMan is
prepared when wpa_s triggers a connection with the last AP we were
connected to that previously deauthenticated us. If it is not done, WiFi
plugin could receive a notification it does not expect and state
machines will not move, resulting in a L2 connection and no IP address.

This should rarely happen because wpa_s should always notify there is a
new BSS through a "BSSAdded" signal before notifying we got connected to
it. If wpa_s does so, everything will be in its place when wpa_s
notifies we got connected.

---
 plugins/wifi.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index fcda4f54fe86..f9e1a724bf31 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2800,6 +2800,57 @@ static void network_changed(GSupplicantNetwork *network, 
const char *property)
        }
 }
 
+static void network_associated(GSupplicantNetwork *network)
+{
+       GSupplicantInterface *interface;
+       struct wifi_data *wifi;
+       struct connman_network *connman_network;
+       const char *identifier;
+
+       DBG("");
+
+       interface = g_supplicant_network_get_interface(network);
+       if (!interface)
+               return;
+
+       wifi = g_supplicant_interface_get_data(interface);
+       if (!wifi)
+               return;
+
+       identifier = g_supplicant_network_get_identifier(network);
+
+       connman_network = connman_device_get_network(wifi->device, identifier);
+       if (!connman_network)
+               return;
+
+       if (wifi->network) {
+               if (wifi->network == connman_network)
+                       return;
+
+               /*
+                * This should never happen, we got associated with
+                * a network different than the one we were expecting.
+                */
+               DBG("Associated to %p while expecting %p",
+                                       connman_network, wifi->network);
+
+               connman_network_set_associating(wifi->network, false);
+       }
+
+       DBG("Reconnecting to previous network %p from wpa_s", connman_network);
+
+       wifi->network = connman_network_ref(connman_network);
+       wifi->retries = 0;
+
+       /*
+        * Interface state changes callback (interface_state) is always
+        * called before network_associated callback thus we need to call
+        * interface_state again in order to process the new state now that
+        * we have the network properly set.
+        */
+       interface_state(interface);
+}
+
 static void apply_peer_services(GSupplicantPeer *peer,
                                struct connman_peer *connman_peer)
 {
@@ -3011,6 +3062,7 @@ static const GSupplicantCallbacks callbacks = {
        .network_added          = network_added,
        .network_removed        = network_removed,
        .network_changed        = network_changed,
+       .network_associated     = network_associated,
        .peer_found             = peer_found,
        .peer_lost              = peer_lost,
        .peer_changed           = peer_changed,
-- 
1.9.1



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

Message: 3
Date: Wed, 21 Jun 2017 15:55:07 +0000
From: [email protected]
To: [email protected]
Cc: [email protected], [email protected],
        [email protected], Jose Blanquicet
        <[email protected]>
Subject: [PATCH v2 5/6] gsupplicant: Add callback to notify the
        associated network
Message-ID:
        
<1498060508-20600-5-git-send-email-jose.blanquicet-melen...@magnetimarelli.com>
        

From: Jose Blanquicet <[email protected]>

Notify WiFi plugin about the network with which we got associated in
order to allow it to get aligned with what is happening at wpa_s level.

---
 gsupplicant/gsupplicant.h |  1 +
 gsupplicant/supplicant.c  | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 678cf8b0ae57..db61595be47b 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -351,6 +351,7 @@ struct _GSupplicantCallbacks {
        void (*network_removed) (GSupplicantNetwork *network);
        void (*network_changed) (GSupplicantNetwork *network,
                                        const char *property);
+       void (*network_associated) (GSupplicantNetwork *network);
        void (*peer_found) (GSupplicantPeer *peer);
        void (*peer_lost) (GSupplicantPeer *peer);
        void (*peer_changed) (GSupplicantPeer *peer,
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 50e4aa63901c..bbc46b4bda04 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -602,6 +602,17 @@ static void callback_network_changed(GSupplicantNetwork 
*network,
        callbacks_pointer->network_changed(network, property);
 }
 
+static void callback_network_associated(GSupplicantNetwork *network)
+{
+       if (!callbacks_pointer)
+               return;
+
+       if (!callbacks_pointer->network_associated)
+               return;
+
+       callbacks_pointer->network_associated(network);
+}
+
 static void callback_peer_found(GSupplicantPeer *peer)
 {
        if (!callbacks_pointer)
@@ -2259,7 +2270,42 @@ static void interface_property(const char *key, 
DBusMessageIter *iter,
                                g_strdup(interface->ifname), g_strdup(str));
                }
        } else if (g_strcmp0(key, "CurrentBSS") == 0) {
+               GSupplicantNetwork *network;
+               const char *path = NULL;
+
+               dbus_message_iter_get_basic(iter, &path);
+               if (g_strcmp0(path, "/") == 0)
+                       return;
+
                interface_bss_added_without_keys(iter, interface);
+
+               network = g_hash_table_lookup(interface->bss_mapping, path);
+               if (!network)
+                       return;
+
+               /*
+                * wpa_s could notify about CurrentBSS in any state once
+                * it got associated. It is not sure such notification will
+                * arrive together with transition to ASSOCIATED state.
+                * In fact, for networks with security WEP or OPEN, it
+                * always arrives together with transition to COMPLETED.
+                */
+               switch (interface->state) {
+               case G_SUPPLICANT_STATE_UNKNOWN:
+               case G_SUPPLICANT_STATE_DISABLED:
+               case G_SUPPLICANT_STATE_DISCONNECTED:
+               case G_SUPPLICANT_STATE_INACTIVE:
+               case G_SUPPLICANT_STATE_SCANNING:
+               case G_SUPPLICANT_STATE_AUTHENTICATING:
+               case G_SUPPLICANT_STATE_ASSOCIATING:
+                       return;
+               case G_SUPPLICANT_STATE_ASSOCIATED:
+               case G_SUPPLICANT_STATE_4WAY_HANDSHAKE:
+               case G_SUPPLICANT_STATE_GROUP_HANDSHAKE:
+               case G_SUPPLICANT_STATE_COMPLETED:
+                       callback_network_associated(network);
+                       break;
+               }
        } else if (g_strcmp0(key, "CurrentNetwork") == 0) {
                interface_network_added(iter, interface);
        } else if (g_strcmp0(key, "BSSs") == 0) {
-- 
1.9.1



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

Message: 4
Date: Wed, 21 Jun 2017 16:08:39 +0000
From: [email protected]
To: [email protected]
Subject: [PATCH] gsupplicant/service: Ease logs reading and analysis
Message-ID:
        
<1498061319-21965-1-git-send-email-jose.blanquicet-melen...@magnetimarelli.com>
        

From: Jose Blanquicet <[email protected]>

---
 gsupplicant/supplicant.c | 2 ++
 src/service.c            | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index bbc46b4bda04..2d5055769152 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -4893,6 +4893,8 @@ int g_supplicant_interface_connect(GSupplicantInterface 
*interface,
        struct interface_data *intf_data;
        int ret = 0;
 
+       SUPPLICANT_DBG("");
+
        if (!interface)
                return -EINVAL;
 
diff --git a/src/service.c b/src/service.c
index 73832f898e32..aff800c14991 100644
--- a/src/service.c
+++ b/src/service.c
@@ -6275,6 +6275,8 @@ int __connman_service_connect(struct connman_service 
*service,
 
        err = service_connect(service);
 
+       DBG("service %p err %d", service, err);
+
        service->connect_reason = reason;
 
        if (err >= 0)
-- 
1.9.1



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

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


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

End of connman Digest, Vol 20, Issue 12
***************************************

Reply via email to