Hello,

If I attempt to connect to a network using WPS (pin code or push button)
and the authentication fails it seems the "WiFi.UseWPS" flag never gets
reset.

This causes the next connection attempt to default to the WPS mode (and
fail) and not use the Agent API to request new authentication information.

I did a quick patch that fixes this behavior but I'm not sure if there is a
better way to do this, maybe in the wifi plugin code by indicating key
error if wps fails.

Any advice on where this fix should go?

I tested this on v1.29 and v1.30, both behave the same way before (and
after) the patch.

diff --git a/external/connman-1.29/src/service.c
b/external/connman-1.29/src/service.c
index 2b2fcd5..dd58767 100644
--- a/external/connman-1.29/src/service.c
+++ b/external/connman-1.29/src/service.c
@@ -5464,6 +5464,11 @@ static int service_indicate_state(struct
connman_service *service)

        case CONNMAN_SERVICE_STATE_FAILURE:

+               /* Clear WPS usage so on retry new method will be asked
from the user */
+               if (service->type == CONNMAN_SERVICE_TYPE_WIFI)
+                       connman_network_set_bool(service->network,
+                                                       "WiFi.UseWPS",
false);
+
                if (service->connect_reason ==
CONNMAN_SERVICE_CONNECT_REASON_USER &&
                        connman_agent_report_error(service, service->path,
                                        error2string(service->error),
_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to