With 802.11 hidden ssids, the network name can only be set if by chance we
receive a probe response from wpa_s.
When calling the JoinNetwork method, we should set the network name at that
time too otherwise hidden ssid will most likely not get a proper network name.

This patch applied on top of connmann git
22e99f1a44c4400e73ff78f51b81a1e16b68d429 seems to fix bug #3445 for me, but as
this is my first poke at connman code, I'm tagging it as RFC.

Signed-off-by: Samuel Ortiz <[email protected]>
---
 src/device.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c
index 1fa2bc6..d78747e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -595,10 +595,21 @@ static DBusMessage *join_network(DBusConnection *conn,
                switch (dbus_message_iter_get_arg_type(&value)) {
                case DBUS_TYPE_STRING:
                        dbus_message_iter_get_basic(&value, &str);
-                       if (g_str_equal(key, "WiFi.SSID") == TRUE)
+                       if (g_str_equal(key, "WiFi.SSID") == TRUE) {
+                               char *name;
+
                                connman_network_set_blob(network, key,
                                                        str, strlen(str));
-                       else
+                               name = g_try_malloc0(strlen(str) + 1);
+                               if (name == NULL)
+                                       return __connman_error_failed(msg,
+                                                                     -ENOMEM);
+
+                               strncpy(name, (char *)str, strlen(str));
+                               connman_network_set_name(network, name);
+                               g_free(name);
+
+                       } else
                                connman_network_set_string(network, key, str);
                        break;
                }
-- 
1.6.3.1

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to