summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-04-28 09:00:06 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2012-04-28 18:05:27 (GMT)
commit2c0b31ac7d185ed6464f25df27cb93835ea812e5 (patch)
treeb9be468a237ae3650dd8e0dcda40d734638320f1 /gsupplicant
parent6416077837319e830418ed325533ff554e96b669 (diff)
downloadconnman-2c0b31ac7d185ed6464f25df27cb93835ea812e5.zip
connman-2c0b31ac7d185ed6464f25df27cb93835ea812e5.tar.gz
connman-2c0b31ac7d185ed6464f25df27cb93835ea812e5.tar.bz2
gsupplicant: Creating an helper function to compute bss security
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/supplicant.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index f7faa8a..8d87dae 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1345,6 +1345,19 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data)
}
}
+static void bss_compute_security(struct g_supplicant_bss *bss)
+{
+ if (bss->ieee8021x == TRUE)
+ bss->security = G_SUPPLICANT_SECURITY_IEEE8021X;
+ else if (bss->psk == TRUE)
+ bss->security = G_SUPPLICANT_SECURITY_PSK;
+ else if (bss->privacy == TRUE)
+ bss->security = G_SUPPLICANT_SECURITY_WEP;
+ else
+ bss->security = G_SUPPLICANT_SECURITY_NONE;
+}
+
+
static void bss_property(const char *key, DBusMessageIter *iter,
void *user_data)
{
@@ -1356,14 +1369,7 @@ static void bss_property(const char *key, DBusMessageIter *iter,
SUPPLICANT_DBG("key %s", key);
if (key == NULL) {
- if (bss->ieee8021x == TRUE)
- bss->security = G_SUPPLICANT_SECURITY_IEEE8021X;
- else if (bss->psk == TRUE)
- bss->security = G_SUPPLICANT_SECURITY_PSK;
- else if (bss->privacy == TRUE)
- bss->security = G_SUPPLICANT_SECURITY_WEP;
- else
- bss->security = G_SUPPLICANT_SECURITY_NONE;
+ bss_compute_security(bss);
add_or_replace_bss_to_network(bss);
return;