Browse Source

WPS: Fix wps_reg command documentation to require BSSID

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.
Jouni Malinen 14 years ago
parent
commit
129eb428b1
2 changed files with 6 additions and 8 deletions
  1. 4 6
      wpa_supplicant/ctrl_iface.c
  2. 2 2
      wpa_supplicant/wpa_cli.c

+ 4 - 6
wpa_supplicant/ctrl_iface.c

@@ -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);
 }
 
 

+ 2 - 2
wpa_supplicant/wpa_cli.c

@@ -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"