[PATCH 02/11] config: Read only wifi config

Jukka Rissanen jukka.rissanen at linux.intel.com
Wed Nov 21 06:30:58 PST 2012


---
 include/provision.h | 2 +-
 plugins/wifi.c      | 2 +-
 src/config.c        | 6 +++++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/provision.h b/include/provision.h
index f154d4f..d6d7c72 100644
--- a/include/provision.h
+++ b/include/provision.h
@@ -42,7 +42,7 @@ struct connman_config_entry {
 	connman_bool_t hidden;
 };
 
-struct connman_config_entry **connman_config_get_entries(void);
+struct connman_config_entry **connman_config_get_entries(const char *type);
 void connman_config_free_entries(struct connman_config_entry **entries);
 
 #ifdef __cplusplus
diff --git a/plugins/wifi.c b/plugins/wifi.c
index d2ab3b0..75ccb14 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -424,7 +424,7 @@ static int get_hidden_connections(int max_ssids,
 	/*
 	 * Check if there are any hidden AP that needs to be provisioned.
 	 */
-	entries = connman_config_get_entries();
+	entries = connman_config_get_entries("wifi");
 	for (i = 0; entries && entries[i]; i++) {
 		int len;
 
diff --git a/src/config.c b/src/config.c
index ef87439..ca76f8e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -953,7 +953,7 @@ int __connman_config_provision_service_ident(struct connman_service *service,
 	return ret;
 }
 
-struct connman_config_entry **connman_config_get_entries(void)
+struct connman_config_entry **connman_config_get_entries(const char *type)
 {
 	GHashTableIter iter_file, iter_config;
 	gpointer value, key;
@@ -977,6 +977,10 @@ struct connman_config_entry **connman_config_get_entries(void)
 							&value) == TRUE) {
 			struct connman_config_service *config = value;
 
+			if (type != NULL &&
+					g_strcmp0(config->type, type) != 0)
+				continue;
+
 			entries[i] = g_try_new0(struct connman_config_entry,
 						1);
 			if (entries[i] == NULL)
-- 
1.7.11.4




More information about the connman mailing list