]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Fix wps_reg command documentation to require BSSID
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 25 Oct 2010 15:56:49 +0000 (18:56 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 25 Oct 2010 15:56:49 +0000 (18:56 +0300)
Replacing the BSSID with 'any' has never worked with wps_reg
command, so better not claim it could work. In addition, reject
this is wpa_supplicant to make it clearer that the operation
fails.

wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_cli.c

index 339eb9bffaf748d0230143d3535bddf14d1bc18a..a67eb36edb3815a84dff6471a631f16d9901a623 100644 (file)
@@ -334,7 +334,7 @@ static int wpa_supplicant_ctrl_iface_wps_oob(struct wpa_supplicant *wpa_s,
 static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
                                             char *cmd)
 {
-       u8 bssid[ETH_ALEN], *_bssid = bssid;
+       u8 bssid[ETH_ALEN];
        char *pin;
        char *new_ssid;
        char *new_auth;
@@ -347,9 +347,7 @@ static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
                return -1;
        *pin++ = '\0';
 
-       if (os_strcmp(cmd, "any") == 0)
-               _bssid = NULL;
-       else if (hwaddr_aton(cmd, bssid)) {
+       if (hwaddr_aton(cmd, bssid)) {
                wpa_printf(MSG_DEBUG, "CTRL_IFACE WPS_REG: invalid BSSID '%s'",
                           cmd);
                return -1;
@@ -357,7 +355,7 @@ static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
 
        new_ssid = os_strchr(pin, ' ');
        if (new_ssid == NULL)
-               return wpas_wps_start_reg(wpa_s, _bssid, pin, NULL);
+               return wpas_wps_start_reg(wpa_s, bssid, pin, NULL);
        *new_ssid++ = '\0';
 
        new_auth = os_strchr(new_ssid, ' ');
@@ -380,7 +378,7 @@ static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
        ap.auth = new_auth;
        ap.encr = new_encr;
        ap.key_hex = new_key;
-       return wpas_wps_start_reg(wpa_s, _bssid, pin, &ap);
+       return wpas_wps_start_reg(wpa_s, bssid, pin, &ap);
 }
 
 
index 5e355a56f649d6b7fa1626ac739cf890825ef693..17afc5faac49896004a47ca3464234a0be16d0bf 100644 (file)
@@ -717,11 +717,11 @@ static int wpa_cli_cmd_wps_reg(struct wpa_ctrl *ctrl, int argc, char *argv[])
                                  key_hex);
        } else {
                printf("Invalid WPS_REG command: need two arguments:\n"
-                      "- BSSID: use 'any' to select any\n"
+                      "- BSSID of the target AP\n"
                       "- AP PIN\n");
                printf("Alternatively, six arguments can be used to "
                       "reconfigure the AP:\n"
-                      "- BSSID: use 'any' to select any\n"
+                      "- BSSID of the target AP\n"
                       "- AP PIN\n"
                       "- new SSID\n"
                       "- new auth (OPEN, WPAPSK, WPA2PSK)\n"