From d1a845b0fa62067f10bb328433c23d52426f4a7d Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Sat, 12 Jun 2010 01:13:21 +0200 Subject: [PATCH] Enable hidden blocks only when hidden SSIDs are around --- plugins/supplicant.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/supplicant.c b/plugins/supplicant.c index 8fe3d63..f7e9a1b 100644 --- a/plugins/supplicant.c +++ b/plugins/supplicant.c @@ -191,6 +191,7 @@ struct supplicant_task { struct connman_network *pending_network; char *path; char *netpath; + gboolean hidden_found; GHashTable *hidden_blocks; gboolean created; enum supplicant_state state; @@ -1835,6 +1836,9 @@ static void properties_reply(DBusPendingCall *call, void *user_data) } } + if (result.ssid == NULL) + task->hidden_found = TRUE; + if (result.frequency > 0 && result.frequency < 14) result.frequency = 2407 + (5 * result.frequency); else if (result.frequency == 14) @@ -1936,10 +1940,10 @@ static void get_properties(struct supplicant_task *task) char *path; path = g_slist_nth_data(task->scan_results, 0); - if (path == NULL) { + if (path == NULL && task->hidden_found == TRUE) { /* * We're done with regular scanning, let's enable the missing - * network blocks. + * network blocks if there are hidden SSIDs around. */ hidden_block_enable(task); goto noscan; @@ -2026,6 +2030,8 @@ static void scan_results_reply(DBusPendingCall *call, void *user_data) task->scan_results = g_slist_append(task->scan_results, path); } + task->hidden_found = FALSE; + g_strfreev(results); dbus_message_unref(reply); -- 2.7.4