From: Marcel Holtmann Date: Wed, 3 Dec 2008 12:50:47 +0000 (+0100) Subject: Don't overwrite security settings if already set X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~4554 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ec68330d2e0c729ad37b0f724b7d2f93653246b;p=profile%2Fivi%2Fconnman.git Don't overwrite security settings if already set --- diff --git a/plugins/wifi.c b/plugins/wifi.c index 294b771..1e7df6b 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -83,10 +83,8 @@ static int network_enable(struct connman_element *element) } } - if (connman_element_get_static_property(element, - "WiFi.Security", &security) == FALSE) - connman_element_get_value(element, - CONNMAN_PROPERTY_ID_WIFI_SECURITY, &security); + connman_element_get_value(element, + CONNMAN_PROPERTY_ID_WIFI_SECURITY, &security); connman_element_get_value(element, CONNMAN_PROPERTY_ID_WIFI_PASSPHRASE, &passphrase); @@ -198,7 +196,6 @@ static void scan_result(struct connman_element *parent, element = find_element(data, network->identifier); if (element == NULL) { - const char *security; guint8 strength; element = connman_element_create(temp); @@ -214,17 +211,20 @@ static void scan_result(struct connman_element *parent, connman_element_add_static_array_property(element, "WiFi.SSID", DBUS_TYPE_BYTE, &network->ssid, network->ssid_len); - if (network->has_rsn == TRUE) - security = "wpa2"; - else if (network->has_wpa == TRUE) - security = "wpa"; - else if (network->has_wep == TRUE) - security = "wep"; - else - security = "none"; + if (element->wifi.security == NULL) { + const char *security; - connman_element_add_static_property(element, "WiFi.Security", - DBUS_TYPE_STRING, &security); + if (network->has_rsn == TRUE) + security = "wpa2"; + else if (network->has_wpa == TRUE) + security = "wpa"; + else if (network->has_wep == TRUE) + security = "wep"; + else + security = "none"; + + element->wifi.security = g_strdup(security); + } strength = network->quality; @@ -235,7 +235,7 @@ static void scan_result(struct connman_element *parent, DBUS_TYPE_INT32, &network->noise); DBG("%s (%s) strength %d", network->identifier, - security, strength); + element->wifi.security, strength); connman_element_register(element, parent); }