Hi Lucio,
On Tue, Sep 21, 2010 at 04:01:17PM -0300, Lucio Maciel wrote:
> From: Lucio Maciel <[email protected]>
>
> If the user changes the security of the AP from wpa to wpa2
> or vice-versa, connman correctly updates the network sctruct
> but don't reflect it on the service.
I think this is something we shouldn't expose to the user. The AP being wpa or
wpa2 is of no interest to the UI or the user. We just need to know if it's
wpa-psk or wpa-eap.
In fact, convert_wifi_security() should be fixed to return
CONNMAN_SERVICE_SECURITY_PSK in the wpa, rsn and psk cases.
Kalle offered to clean that up as we eventually want to get rid of
CONNMAN_SERVICE_SECURITY_WPA and CONNMAN_SERVICE_SECURITY_RSN. Not sure if he
had time to work on it.
Cheers,
Samuel.
> This changes the service security and emits a Security PropertyChanged
> signal.
> ---
> src/service.c | 26 ++++++++++++++++++++++++--
> 1 files changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/src/service.c b/src/service.c
> index 25d0f9d..249c748 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -657,6 +657,19 @@ const char *__connman_service_default(void)
> return __connman_service_type2string(service->type);
> }
> +static void security_changed(struct connman_service *service)
> +{
> + const char *str;
> +
> + str = security2string(service->security);
> + if (str == NULL)
> + return;
> +
> + connman_dbus_property_changed_basic(service->path,
> + CONNMAN_SERVICE_INTERFACE, "Security",
> + DBUS_TYPE_STRING, &str);
> +}
> +
> static void mode_changed(struct connman_service *service)
> {
> const char *str;
> @@ -3750,7 +3763,7 @@ void
> __connman_service_update_from_network(struct connman_network
> *network)
> connman_uint8_t strength, value;
> connman_bool_t roaming;
> GSequenceIter *iter;
> - const char *name;
> + const char *name, *security;
> connman_bool_t stats_enable;
> DBG("network %p", network);
> @@ -3782,7 +3795,7 @@ void
> __connman_service_update_from_network(struct connman_network
> *network)
> roaming:
> roaming = connman_network_get_bool(service->network, "Roaming");
> if (roaming == service->roaming)
> - goto done;
> + goto security;
> stats_enable = stats_enabled(service);
> if (stats_enable == TRUE)
> @@ -3799,6 +3812,15 @@ roaming:
> if (iter != NULL)
> g_sequence_sort_changed(iter, service_compare, NULL);
> +security:
> + security = connman_network_get_string(service->network,
> "WiFi.Security");
> + if (!security || service->security == convert_wifi_security(security))
> + goto done;
> +
> + service->security = convert_wifi_security(security);
> +
> + security_changed(service);
> +
> done:
> if (service->type != CONNMAN_SERVICE_TYPE_CELLULAR)
> return;
> _______________________________________________
> connman mailing list
> [email protected]
> http://lists.connman.net/listinfo/connman
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman