Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171853
b: refs/heads/master
c: af2ced6
h: refs/heads/master
i:
  171851: b556e7d
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Nov 18, 2009
1 parent e12c686 commit 6cdfa1e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c951ad3550ab40071bb0f222ba6125845769c08a
refs/heads/master: af2ced6a32dafb71d21b726c06df57fc574093d7
47 changes: 23 additions & 24 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1818,11 +1818,11 @@ static void ieee80211_rx_michael_mic_report(struct ieee80211_hdr *hdr,
* Some hardware seem to generate incorrect Michael MIC
* reports; ignore them to avoid triggering countermeasures.
*/
goto ignore;
return;
}

if (!ieee80211_has_protected(hdr->frame_control))
goto ignore;
return;

if (rx->sdata->vif.type == NL80211_IFTYPE_AP && keyidx) {
/*
Expand All @@ -1831,18 +1831,15 @@ static void ieee80211_rx_michael_mic_report(struct ieee80211_hdr *hdr,
* group keys and only the AP is sending real multicast
* frames in the BSS.
*/
goto ignore;
return;
}

if (!ieee80211_is_data(hdr->frame_control) &&
!ieee80211_is_auth(hdr->frame_control))
goto ignore;
return;

mac80211_ev_michael_mic_failure(rx->sdata, keyidx, hdr, NULL,
GFP_ATOMIC);
ignore:
dev_kfree_skb(rx->skb);
rx->skb = NULL;
}

/* TODO: use IEEE80211_RX_FRAGMENTED */
Expand Down Expand Up @@ -2064,8 +2061,6 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
return 0;
break;
case NL80211_IFTYPE_MONITOR:
/* take everything */
break;
case NL80211_IFTYPE_UNSPECIFIED:
case __NL80211_IFTYPE_AFTER_LAST:
/* should never get here */
Expand Down Expand Up @@ -2097,38 +2092,35 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
memset(&rx, 0, sizeof(rx));
rx.skb = skb;
rx.local = local;

rx.status = status;
rx.rate = rate;

if (ieee80211_is_data(hdr->frame_control) || ieee80211_is_mgmt(hdr->frame_control))
local->dot11ReceivedFragmentCount++;

rx.sta = sta_info_get(local, hdr->addr2);
if (rx.sta) {
rx.sdata = rx.sta->sdata;
rx.dev = rx.sta->sdata->dev;
}

if ((status->flag & RX_FLAG_MMIC_ERROR)) {
ieee80211_rx_michael_mic_report(hdr, &rx);
return;
}

if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) ||
test_bit(SCAN_OFF_CHANNEL, &local->scanning)))
rx.flags |= IEEE80211_RX_IN_SCAN;

ieee80211_parse_qos(&rx);
ieee80211_verify_alignment(&rx);

skb = rx.skb;
rx.sta = sta_info_get(local, hdr->addr2);
if (rx.sta) {
rx.sdata = rx.sta->sdata;
rx.dev = rx.sta->sdata->dev;
}

if (rx.sdata && ieee80211_is_data(hdr->frame_control)) {
rx.flags |= IEEE80211_RX_RA_MATCH;
prepares = prepare_for_handlers(rx.sdata, &rx, hdr);
if (prepares)
prev = rx.sdata;
if (prepares) {
if (status->flag & RX_FLAG_MMIC_ERROR) {
if (rx.flags & IEEE80211_RX_RA_MATCH)
ieee80211_rx_michael_mic_report(hdr, &rx);
} else
prev = rx.sdata;
}
} else list_for_each_entry_rcu(sdata, &local->interfaces, list) {
if (!netif_running(sdata->dev))
continue;
Expand All @@ -2143,6 +2135,13 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
if (!prepares)
continue;

if (status->flag & RX_FLAG_MMIC_ERROR) {
rx.sdata = sdata;
if (rx.flags & IEEE80211_RX_RA_MATCH)
ieee80211_rx_michael_mic_report(hdr, &rx);
continue;
}

/*
* frame is destined for this interface, but if it's not
* also for the previous one we handle that after the
Expand Down

0 comments on commit 6cdfa1e

Please sign in to comment.