Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278624
b: refs/heads/master
c: 3df6eae
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Dec 6, 2011
1 parent ba5eea7 commit 697a00a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 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: aa5b549215f85cf48a7040bc9d33c4dae0c7d11a
refs/heads/master: 3df6eaea76a9e1351b539541c0314129a0e4b10c
17 changes: 17 additions & 0 deletions trunk/include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,23 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
return false;
}

/**
* ieee80211_is_public_action - check if frame is a public action frame
* @hdr: the frame
* @len: length of the frame
*/
static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
size_t len)
{
struct ieee80211_mgmt *mgmt = (void *)hdr;

if (len < IEEE80211_MIN_ACTION_SIZE)
return false;
if (!ieee80211_is_action(hdr->frame_control))
return false;
return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC;
}

/**
* ieee80211_fhss_chan_to_freq - get channel frequency
* @channel: the FHSS channel
Expand Down
13 changes: 10 additions & 3 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2797,10 +2797,17 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
return 0;
} else if (!ieee80211_bssid_match(bssid,
sdata->vif.addr)) {
/*
* Accept public action frames even when the
* BSSID doesn't match, this is used for P2P
* and location updates. Note that mac80211
* itself never looks at these frames.
*/
if (!(status->rx_flags & IEEE80211_RX_IN_SCAN) &&
ieee80211_is_public_action(hdr, skb->len))
return 1;
if (!(status->rx_flags & IEEE80211_RX_IN_SCAN) &&
!ieee80211_is_beacon(hdr->frame_control) &&
!(ieee80211_is_action(hdr->frame_control) &&
sdata->vif.p2p))
!ieee80211_is_beacon(hdr->frame_control))
return 0;
status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
}
Expand Down

0 comments on commit 697a00a

Please sign in to comment.