diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-04-25 14:22:14 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-04-25 14:03:26 +0200 |
commit | c9effb3d1ec0b151553a17bdb9a0403bbdac8763 (patch) | |
tree | 33ac40cd602c70ff4977c80a0851b5fd7a975e10 | |
parent | dae33533eaefea2c78fc24f3ecccb59e4b9edd21 (diff) | |
download | connman-c9effb3d1ec0b151553a17bdb9a0403bbdac8763.tar.gz connman-c9effb3d1ec0b151553a17bdb9a0403bbdac8763.tar.bz2 connman-c9effb3d1ec0b151553a17bdb9a0403bbdac8763.zip |
service: Fixing which wpspin we set according to PBC method or not
For PBC method, the WiFi.PinWPS has to be NULL.
Fixes BMC#25076
-rw-r--r-- | src/service.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/service.c b/src/service.c index 8814754b..ac695c44 100644 --- a/src/service.c +++ b/src/service.c @@ -4359,7 +4359,7 @@ int __connman_service_add_passphrase(struct connman_service *service, return err; } -static int check_wpspin(const char *wpspin) +static int check_wpspin(struct connman_service *service, const char *wpspin) { int length; guint i; @@ -4370,8 +4370,11 @@ static int check_wpspin(const char *wpspin) length = strlen(wpspin); /* If 0, it will mean user wants to use PBC method */ - if (length == 0) + if (length == 0) { + connman_network_set_string(service->network, + "WiFi.PinWPS", NULL); return 0; + } /* A WPS PIN is always 8 chars length, * its content is in digit representation. @@ -4383,6 +4386,8 @@ static int check_wpspin(const char *wpspin) if (!isdigit((unsigned char) wpspin[i])) return -ENOKEY; + connman_network_set_string(service->network, "WiFi.PinWPS", wpspin); + return 0; } @@ -4412,13 +4417,12 @@ static void request_input_cb (struct connman_service *service, return; } - err = check_wpspin(wpspin); - if (err < 0) - goto done; - if (service->network != NULL) { + if (wps == TRUE && service->network != NULL) { + err = check_wpspin(service, wpspin); + if (err < 0) + goto done; + connman_network_set_bool(service->network, "WiFi.UseWPS", wps); - connman_network_set_string(service->network, "WiFi.PinWPS", - wpspin); } if (identity != NULL) |