Replace hostapd_michael_mic_failure() with generic driver event

This commit is contained in:
Jouni Malinen 2009-12-13 21:17:11 +02:00
parent ac7043f265
commit 1cd973d501
6 changed files with 24 additions and 12 deletions

View File

@ -427,12 +427,6 @@ void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
#endif /* NEED_AP_MLME */ #endif /* NEED_AP_MLME */
void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr)
{
michael_mic_failure(hapd, addr, 1);
}
struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd, struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
const u8 *addr) const u8 *addr)
{ {

View File

@ -1969,7 +1969,6 @@ void hostapd_mgmt_rx(struct hostapd_data *hapd, u8 *buf, size_t len,
u16 stype, struct hostapd_frame_info *fi); u16 stype, struct hostapd_frame_info *fi);
void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len, void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
u16 stype, int ok); u16 stype, int ok);
void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr);
struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd, struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
const u8 *addr); const u8 *addr);
void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,

View File

@ -807,7 +807,12 @@ madwifi_wireless_event_wireless_custom(struct madwifi_driver_data *drv,
} }
pos += 5; pos += 5;
if (hwaddr_aton(pos, addr) == 0) { if (hwaddr_aton(pos, addr) == 0) {
hostapd_michael_mic_failure(drv->hapd, addr); union wpa_event_data data;
os_memset(&data, 0, sizeof(data));
data.michael_mic_failure.unicast = 1;
data.michael_mic_failure.src = addr;
wpa_supplicant_event(drv->hapd,
EVENT_MICHAEL_MIC_FAILURE, &data);
} else { } else {
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"MLME-MICHAELMICFAILURE.indication " "MLME-MICHAELMICFAILURE.indication "

View File

@ -601,7 +601,6 @@ static void
bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx) bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
{ {
struct bsd_driver_data *drv = ctx; struct bsd_driver_data *drv = ctx;
struct hostapd_data *hapd = drv->hapd;
char buf[2048]; char buf[2048];
struct if_announcemsghdr *ifan; struct if_announcemsghdr *ifan;
struct rt_msghdr *rtm; struct rt_msghdr *rtm;
@ -609,6 +608,7 @@ bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
struct ieee80211_join_event *join; struct ieee80211_join_event *join;
struct ieee80211_leave_event *leave; struct ieee80211_leave_event *leave;
int n; int n;
union wpa_event_data data;
n = read(sock, buf, sizeof(buf)); n = read(sock, buf, sizeof(buf));
if (n < 0) { if (n < 0) {
@ -652,7 +652,11 @@ bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
"Michael MIC failure wireless event: " "Michael MIC failure wireless event: "
"keyix=%u src_addr=" MACSTR, mic->iev_keyix, "keyix=%u src_addr=" MACSTR, mic->iev_keyix,
MAC2STR(mic->iev_src)); MAC2STR(mic->iev_src));
hostapd_michael_mic_failure(hapd, mic->iev_src); os_memset(&data, 0, sizeof(data));
data.michael_mic_failure.unicast = 1;
data.michael_mic_failure.src = mic->iev_src;
wpa_supplicant_event(drv->hapd,
EVENT_MICHAEL_MIC_FAILURE, &data);
break; break;
} }
break; break;

View File

@ -846,7 +846,12 @@ hostapd_wireless_event_wireless_custom(struct hostap_driver_data *drv,
} }
pos += 5; pos += 5;
if (hwaddr_aton(pos, addr) == 0) { if (hwaddr_aton(pos, addr) == 0) {
hostapd_michael_mic_failure(drv->hapd, addr); union wpa_event_data data;
os_memset(&data, 0, sizeof(data));
data.michael_mic_failure.unicast = 1;
data.michael_mic_failure.src = addr;
wpa_supplicant_event(drv->hapd,
EVENT_MICHAEL_MIC_FAILURE, &data);
} else { } else {
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"MLME-MICHAELMICFAILURE.indication " "MLME-MICHAELMICFAILURE.indication "

View File

@ -908,7 +908,12 @@ madwifi_wireless_event_wireless_custom(struct madwifi_driver_data *drv,
} }
pos += 5; pos += 5;
if (hwaddr_aton(pos, addr) == 0) { if (hwaddr_aton(pos, addr) == 0) {
hostapd_michael_mic_failure(drv->hapd, addr); union wpa_event_data data;
os_memset(&data, 0, sizeof(data));
data.michael_mic_failure.unicast = 1;
data.michael_mic_failure.src = addr;
wpa_supplicant_event(drv->hapd,
EVENT_MICHAEL_MIC_FAILURE, &data);
} else { } else {
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"MLME-MICHAELMICFAILURE.indication " "MLME-MICHAELMICFAILURE.indication "