diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-06-15 16:00:21 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-06-18 10:57:08 +0300 |
commit | fc41a18566f0bb753fd8ce35873d1442942f464c (patch) | |
tree | f198bceea5eac8f186f15fd13eae23b9c1e13b11 /plugins/wifi.c | |
parent | 3ca789e446848eed6ca3c00af080cd737d115dcb (diff) | |
download | connman-fc41a18566f0bb753fd8ce35873d1442942f464c.tar.gz connman-fc41a18566f0bb753fd8ce35873d1442942f464c.tar.bz2 connman-fc41a18566f0bb753fd8ce35873d1442942f464c.zip |
service: Connecting hidden network waits until connected
If the user is connecting to hidden network, then we delay the
return of the reply to caller until the real service has connected.
This way the user connect to hidden and non-hidden networks works
the same way from caller point of view.
Diffstat (limited to 'plugins/wifi.c')
-rw-r--r-- | plugins/wifi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c index 3cd2be29..3f9afad9 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -68,6 +68,7 @@ struct hidden_params { unsigned int ssid_len; char *identity; char *passphrase; + gpointer user_data; }; /** @@ -664,6 +665,7 @@ static void scan_callback(int result, GSupplicantInterface *interface, DBG("result %d", result); if (wifi != NULL && wifi->hidden != NULL) { + connman_network_clear_hidden(wifi->hidden->user_data); hidden_free(wifi->hidden); wifi->hidden = NULL; } @@ -865,7 +867,8 @@ static int wifi_scan_fast(struct connman_device *device) */ static int wifi_scan_hidden(struct connman_device *device, const char *ssid, unsigned int ssid_len, - const char *identity, const char* passphrase) + const char *identity, const char* passphrase, + gpointer user_data) { struct wifi_data *wifi = connman_device_get_data(device); GSupplicantScanParams *scan_params = NULL; @@ -911,6 +914,7 @@ static int wifi_scan_hidden(struct connman_device *device, hidden->ssid_len = ssid_len; hidden->identity = g_strdup(identity); hidden->passphrase = g_strdup(passphrase); + hidden->user_data = user_data; wifi->hidden = hidden; connman_device_ref(device); @@ -1572,7 +1576,9 @@ static void network_added(GSupplicantNetwork *supplicant_network) ssid_len) == 0) { connman_network_connect_hidden(network, wifi->hidden->identity, - wifi->hidden->passphrase); + wifi->hidden->passphrase, + wifi->hidden->user_data); + wifi->hidden->user_data = NULL; hidden_free(wifi->hidden); wifi->hidden = NULL; } |