service: Do hidden network scan for the given SSID
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 2 Dec 2011 14:18:34 +0000 (16:18 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 12 Dec 2011 09:44:40 +0000 (10:44 +0100)
When a service is set as hidden, do a network scan for the
SSID/name supplied via the Agent API. End the connection
attempt on the original hidden service.

src/service.c

index 299844e..d89036d 100644 (file)
@@ -3984,9 +3984,18 @@ static void request_input_cb (struct connman_service *service,
                        const char *identity, const char *passphrase,
                        void *user_data)
 {
+       struct connman_device *device;
+
        DBG ("RequestInput return, %p", service);
 
-       if (values_received == FALSE) {
+       if (service->hidden == TRUE && name_len > 0 && name_len <= 32) {
+               device = connman_network_get_device(service->network);
+               __connman_device_request_hidden_scan(device,
+                                               name, name_len,
+                                               identity, passphrase);
+       }
+
+       if (values_received == FALSE || service->hidden == TRUE) {
                service_complete(service);
                services_changed(FALSE);
                __connman_device_request_scan(CONNMAN_DEVICE_TYPE_UNKNOWN);