[PATCH] wifi: write Wifi Mode to network properties

Manfred Kober manfred.kober at gmx.de
Wed Feb 1 07:02:52 PST 2012


From: Manfred Kober <manfred.kober at gmx.de>

Fixes BMC#24737
Currently adhoc networks are shown in the service list, although
connecting to those is not supported. Filtering in network.c fails
because the WiFi.Mode was not set so far.

---
 plugins/wifi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 0860938..de46ec3 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1111,7 +1111,7 @@ static void network_added(GSupplicantNetwork *supplicant_network)
 	struct connman_network *network;
 	GSupplicantInterface *interface;
 	struct wifi_data *wifi;
-	const char *name, *identifier, *security, *group;
+	const char *name, *identifier, *security, *group, *mode;
 	const unsigned char *ssid;
 	unsigned int ssid_len;
 	connman_bool_t wps;
@@ -1125,6 +1125,7 @@ static void network_added(GSupplicantNetwork *supplicant_network)
 	security = g_supplicant_network_get_security(supplicant_network);
 	group = g_supplicant_network_get_identifier(supplicant_network);
 	wps = g_supplicant_network_get_wps(supplicant_network);
+	mode = g_supplicant_network_get_mode(supplicant_network);
 
 	if (wifi == NULL)
 		return;
@@ -1163,6 +1164,7 @@ static void network_added(GSupplicantNetwork *supplicant_network)
 			g_supplicant_network_get_frequency(supplicant_network));
 
 	connman_network_set_available(network, TRUE);
+	connman_network_set_string(network, "WiFi.Mode", mode);
 
 	if (ssid != NULL)
 		connman_network_set_group(network, group);
-- 
1.7.4.1

-- 

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



More information about the connman mailing list