mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-29 10:48:22 -05:00
nl80211: Fix foreign address filtering for MLME frame events
Commit 97279d8d1a
started filtering MLME
frame events based on Address 1 (destination) field. This works fine for
frames sent to us, but it did filter out some corner cases where we
actually want to process an event based on a frame sent by us. The main
such case is deauthentication or disassociation triggered by something
external to wpa_supplicant in the system. Fix this by accepting events
for frames where either Address 1 or 2 (transmitter) matches the
interface address.
Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
53aafe75e0
commit
455299fb40
@ -1493,17 +1493,18 @@ static void mlme_event(struct i802_bss *bss,
|
|||||||
|
|
||||||
data = nla_data(frame);
|
data = nla_data(frame);
|
||||||
len = nla_len(frame);
|
len = nla_len(frame);
|
||||||
if (len < 4 + ETH_ALEN) {
|
if (len < 4 + 2 * ETH_ALEN) {
|
||||||
wpa_printf(MSG_MSGDUMP, "nl80211: MLME event %d on %s(" MACSTR
|
wpa_printf(MSG_MSGDUMP, "nl80211: MLME event %d on %s(" MACSTR
|
||||||
") - too short",
|
") - too short",
|
||||||
cmd, bss->ifname, MAC2STR(bss->addr));
|
cmd, bss->ifname, MAC2STR(bss->addr));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wpa_printf(MSG_MSGDUMP, "nl80211: MLME event %d on %s(" MACSTR ") A1="
|
wpa_printf(MSG_MSGDUMP, "nl80211: MLME event %d on %s(" MACSTR ") A1="
|
||||||
MACSTR, cmd, bss->ifname, MAC2STR(bss->addr),
|
MACSTR " A2=" MACSTR, cmd, bss->ifname, MAC2STR(bss->addr),
|
||||||
MAC2STR(data + 4));
|
MAC2STR(data + 4), MAC2STR(data + 4 + ETH_ALEN));
|
||||||
if (cmd != NL80211_CMD_FRAME_TX_STATUS && !(data[4] & 0x01) &&
|
if (cmd != NL80211_CMD_FRAME_TX_STATUS && !(data[4] & 0x01) &&
|
||||||
os_memcmp(bss->addr, data + 4, ETH_ALEN) != 0) {
|
os_memcmp(bss->addr, data + 4, ETH_ALEN) != 0 &&
|
||||||
|
os_memcmp(bss->addr, data + 4 + ETH_ALEN, ETH_ALEN) != 0) {
|
||||||
wpa_printf(MSG_MSGDUMP, "nl80211: %s: Ignore MLME frame event "
|
wpa_printf(MSG_MSGDUMP, "nl80211: %s: Ignore MLME frame event "
|
||||||
"for foreign address", bss->ifname);
|
"for foreign address", bss->ifname);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user