diff -urNbBw hostapd-cvs251104/driver_madwifi.c hostapd-cvs251104.patched/driver_madwifi.c --- hostapd-cvs251104/driver_madwifi.c 2004-09-21 04:37:27.000000000 +0100 +++ hostapd-cvs251104.patched/driver_madwifi.c 2004-11-30 08:50:21.000000000 +0000 @@ -564,6 +564,7 @@ { struct hostapd_data *hapd = drv->hapd; struct sta_info *sta; + struct hostapd_config *conf = hapd->conf; struct ieee80211req_wpaie ie; int new_assoc, ielen, res; @@ -573,6 +574,7 @@ sta = ap_sta_add(hapd, addr); if (sta == NULL) return -1; + if (conf->wpa) { /* * Fetch negotiated WPA/RSN parameters from the system. */ @@ -604,7 +606,11 @@ } memcpy(sta->wpa_ie, ie.wpa_ie, ielen); sta->wpa_ie_len = ielen; - + } + else { + sta->wpa_ie = NULL; + sta->wpa_ie_len = 0; + } /* * Now that the internal station state is setup * kick the authenticator into action. diff -urNbBw hostapd-cvs251104/sta_info.c hostapd-cvs251104.patched/sta_info.c --- hostapd-cvs251104/sta_info.c 2004-09-26 19:54:36.000000000 +0100 +++ hostapd-cvs251104.patched/sta_info.c 2004-11-30 09:00:41.000000000 +0000 @@ -131,6 +131,7 @@ free(sta->last_assoc_req); free(sta->challenge); + if(sta->wpa_ie != NULL) free(sta->wpa_ie); free(sta); diff -urNbBw hostapd-cvs251104/wpa.c hostapd-cvs251104.patched/wpa.c --- hostapd-cvs251104/wpa.c 2004-10-03 22:09:20.000000000 +0100 +++ hostapd-cvs251104.patched/wpa.c 2004-11-30 08:56:37.000000000 +0000 @@ -1926,7 +1926,8 @@ "event %d notification", event); if (sm == NULL) return; - + if(!hapd->conf->wpa) + return; switch (event) { case WPA_AUTH: case WPA_ASSOC: