[PATCH] hostapd: respect rsn_pairwise in MadWifi

Pavel Roskin proski
Wed May 21 18:43:59 PDT 2008


MadWifi uses the same set of pairwise ciphers in WPA and RSN information
elements.  Tell the driver to announce all ciphers enabled either for
WPA1 or RSN.

In particular, if only RSN is enabled, use the rsn_pairwise and not
wpa_pairwise.
---

 hostapd/driver_madwifi.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/hostapd/driver_madwifi.c b/hostapd/driver_madwifi.c
index 9c3ebff..b1b1379 100644
--- a/hostapd/driver_madwifi.c
+++ b/hostapd/driver_madwifi.c
@@ -217,6 +217,7 @@ madwifi_configure_wpa(struct madwifi_driver_data *drv)
 	struct hostapd_data *hapd = drv->hapd;
 	struct hostapd_bss_config *conf = hapd->conf;
 	int v;
+	int pairwise;
 
 	switch (conf->wpa_group) {
 	case WPA_CIPHER_CCMP:
@@ -253,12 +254,18 @@ madwifi_configure_wpa(struct madwifi_driver_data *drv)
 		}
 	}
 
+	pairwise = 0;
+	if (conf->wpa & 1)
+		pairwise |= conf->wpa_pairwise;
+	if (conf->wpa & 2)
+		pairwise |= conf->rsn_pairwise;
+
 	v = 0;
-	if (conf->wpa_pairwise & WPA_CIPHER_CCMP)
+	if (pairwise & WPA_CIPHER_CCMP)
 		v |= 1<<IEEE80211_CIPHER_AES_CCM;
-	if (conf->wpa_pairwise & WPA_CIPHER_TKIP)
+	if (pairwise & WPA_CIPHER_TKIP)
 		v |= 1<<IEEE80211_CIPHER_TKIP;
-	if (conf->wpa_pairwise & WPA_CIPHER_NONE)
+	if (pairwise & WPA_CIPHER_NONE)
 		v |= 1<<IEEE80211_CIPHER_NONE;
 	wpa_printf(MSG_DEBUG, "%s: pairwise key ciphers=0x%x", __func__, v);
 	if (set80211param(drv, IEEE80211_PARAM_UCASTCIPHERS, v)) {



More information about the Hostap mailing list