[net-client] Don't set NULL ProfileName in request_table for hidden AP. 69/92969/2
authorSaurav Babu <saurav.babu@samsung.com>
Wed, 19 Oct 2016 14:16:20 +0000 (19:46 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Thu, 17 Nov 2016 11:09:30 +0000 (03:09 -0800)
In case of hidden AP connection, AP is not yet scanned so no profile
name exists. This patch sets the group name of hidden AP created using ssid,
mode and security as ProfileName in request_table. If no profile name is
set in request_table then libnet-client sends NET_ERR_OPERATION_ABORTED
error in connection open response if any AP is disconnected.
Ideally NET_ERR_OPERATION_ABORTED should only be sent in conneciton open
response when hidden AP requested for connection gets disconnected.

Change-Id: Ieea15637729b5c7baf225bac9312c5782eb984f9
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/network-dbus-request.c

index 8c0dd68..7a97ee0 100755 (executable)
@@ -1393,20 +1393,12 @@ int _net_dbus_connect_service(const net_wifi_connect_service_info_t *wifi_connec
        }
 
        if (wifi_connection_info->is_hidden == TRUE) {
-               int target = 0;
                char *target_name = __net_make_group_name(wifi_connection_info->ssid,
                                wifi_connection_info->mode,
                                wifi_connection_info->security);
-
-               for (target = 0; target < profile_count; target++) {
-                       if (g_strstr_len(profile_info[target].ProfileName,
-                                       NET_PROFILE_NAME_LEN_MAX+1, target_name) != NULL) {
-                               g_strlcpy(request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].ProfileName,
-                                               profile_info[target].ProfileName, NET_PROFILE_NAME_LEN_MAX+1);
-
-                               break;
-                       }
-               }
+               NETWORK_LOG(NETWORK_HIGH, "Hidden target name %s", target_name);
+               g_strlcpy(request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].ProfileName,
+                                 target_name, NET_PROFILE_NAME_LEN_MAX+1);
 
                g_free(target_name);
        } else {