[PATCH 2/2] WPA: fix PROTO field being printed incorrectly as WPA VERSION in debug logs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During SET AP operation, the WPA proto (WPA/RSN) field is incorrectly
printed as "wpa_version", while the actual WPA version is not printed. So
add a new debug print for the bitmask of AP supported WPA versions (1,2,3).

And since the AP param member wpa_driver_ap_params::wpa_version actually
indicates the proto field and not the WPA version, rename this member from
"wpa_version => wpa_proto", to make this consistent with the struct member
wpa_driver_associate_params::wpa_proto currently used during STA CONNECT.

Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@xxxxxxxxxxxx>
---
 src/ap/beacon.c              | 2 +-
 src/drivers/driver.h         | 4 ++--
 src/drivers/driver_atheros.c | 4 ++--
 src/drivers/driver_nl80211.c | 5 +++--
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 6cfaf099e..69e6debf2 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -2560,7 +2560,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 		hapd->conf->rsn_override_key_mgmt |
 		hapd->conf->rsn_override_key_mgmt_2;
 	params->auth_algs = hapd->conf->auth_algs;
-	params->wpa_version = hapd->conf->wpa;
+	params->wpa_proto = hapd->conf->wpa;
 	params->privacy = hapd->conf->wpa;
 #ifdef CONFIG_WEP
 	params->privacy |= hapd->conf->ssid.wep.keys_set ||
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 0a0532353..1e871b266 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1633,9 +1633,9 @@ struct wpa_driver_ap_params {
 	unsigned int auth_algs;
 
 	/**
-	 * wpa_version - WPA_PROTO_* bitfield
+	 * wpa_proto - WPA_PROTO_* bitfield
 	 */
-	unsigned int wpa_version;
+	unsigned int wpa_proto;
 
 	/**
 	 * privacy - Whether privacy is used in the BSS
diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index 94db413eb..049d87efa 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -1927,10 +1927,10 @@ static int atheros_set_ap(void *priv, struct wpa_driver_ap_params *params)
 
 	wpa_printf(MSG_DEBUG, "atheros: set_ap - pairwise_ciphers=0x%x "
 		   "group_cipher=0x%x key_mgmt_suites=0x%x auth_algs=0x%x "
-		   "wpa_version=0x%x privacy=%d interworking=%d",
+		   "wpa_proto=0x%x privacy=%d interworking=%d",
 		   params->pairwise_ciphers, params->group_cipher,
 		   params->key_mgmt_suites, params->auth_algs,
-		   params->wpa_version, params->privacy, params->interworking);
+		   params->wpa_proto, params->privacy, params->interworking);
 	wpa_hexdump_ascii(MSG_DEBUG, "atheros: SSID",
 			  params->ssid, params->ssid_len);
 	if (params->hessid)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 8684b43d4..fffd83681 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5366,9 +5366,10 @@ static int wpa_driver_nl80211_set_ap(void *priv,
 			goto fail;
 	}
 
-	wpa_printf(MSG_DEBUG, "nl80211: wpa_version=0x%x", params->wpa_version);
+	wpa_printf(MSG_DEBUG, "nl80211: wpa_proto=0x%x", params->wpa_proto);
 	ver = wpa_ver_supported(drv, params->key_mgmt_suites,
-				params->wpa_version);
+				params->wpa_proto);
+	wpa_printf(MSG_DEBUG, "nl80211: wpa_version=0x%x", ver);
 	if (ver &&
 	    nla_put_u32(msg, NL80211_ATTR_WPA_VERSIONS, ver))
 		goto fail;
-- 
2.43.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux