]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix foreign address filtering for MLME frame events
authorJouni Malinen <j@w1.fi>
Mon, 13 May 2013 08:53:21 +0000 (11:53 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 13 May 2013 08:53:21 +0000 (11:53 +0300)
Commit 97279d8d1ad40bd7d884af8e2fc26dff0163331a 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>

src/drivers/driver_nl80211.c

index d66d2e36a579bc1bd7523a497b2385a7817be3b9..6bbc3dacbead0f71321df3719615bb4ae17a5ae2 100644 (file)
@@ -1493,17 +1493,18 @@ static void mlme_event(struct i802_bss *bss,
 
        data = nla_data(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
                           ") - too short",
                           cmd, bss->ifname, MAC2STR(bss->addr));
                return;
        }
        wpa_printf(MSG_MSGDUMP, "nl80211: MLME event %d on %s(" MACSTR ") A1="
-                  MACSTR, cmd, bss->ifname, MAC2STR(bss->addr),
-                  MAC2STR(data + 4));
+                  MACSTR " A2=" MACSTR, cmd, bss->ifname, MAC2STR(bss->addr),
+                  MAC2STR(data + 4), MAC2STR(data + 4 + ETH_ALEN));
        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 "
                           "for foreign address", bss->ifname);
                return;