Skip to content

Commit

Permalink
Merge tag 'mac80211-for-davem-2017-05-23' of git://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
Just two fixes this time:
 * fix the scheduled scan "BUG: scheduling while atomic"
 * check mesh address extension flags more strictly
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed May 24, 2017
2 parents 0ff50e8 + 1b57b62 commit 029c581
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
if (is_multicast_ether_addr(hdr->addr1)) {
mpp_addr = hdr->addr3;
proxied_addr = mesh_hdr->eaddr1;
} else if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6) {
} else if ((mesh_hdr->flags & MESH_FLAGS_AE) ==
MESH_FLAGS_AE_A5_A6) {
/* has_a4 already checked in ieee80211_rx_mesh_check */
mpp_addr = hdr->addr4;
proxied_addr = mesh_hdr->eaddr2;
Expand Down
8 changes: 4 additions & 4 deletions net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ cfg80211_find_sched_scan_req(struct cfg80211_registered_device *rdev, u64 reqid)
{
struct cfg80211_sched_scan_request *pos;

ASSERT_RTNL();
WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held());

list_for_each_entry(pos, &rdev->sched_scan_req_list, list) {
list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list) {
if (pos->reqid == reqid)
return pos;
}
Expand Down Expand Up @@ -398,13 +398,13 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy, u64 reqid)
trace_cfg80211_sched_scan_results(wiphy, reqid);
/* ignore if we're not scanning */

rtnl_lock();
rcu_read_lock();
request = cfg80211_find_sched_scan_req(rdev, reqid);
if (request) {
request->report_results = true;
queue_work(cfg80211_wq, &rdev->sched_scan_res_wk);
}
rtnl_unlock();
rcu_read_unlock();
}
EXPORT_SYMBOL(cfg80211_sched_scan_results);

Expand Down
10 changes: 6 additions & 4 deletions net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
if (iftype == NL80211_IFTYPE_MESH_POINT)
skb_copy_bits(skb, hdrlen, &mesh_flags, 1);

mesh_flags &= MESH_FLAGS_AE;

switch (hdr->frame_control &
cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) {
case cpu_to_le16(IEEE80211_FCTL_TODS):
Expand All @@ -469,9 +471,9 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
iftype != NL80211_IFTYPE_STATION))
return -1;
if (iftype == NL80211_IFTYPE_MESH_POINT) {
if (mesh_flags & MESH_FLAGS_AE_A4)
if (mesh_flags == MESH_FLAGS_AE_A4)
return -1;
if (mesh_flags & MESH_FLAGS_AE_A5_A6) {
if (mesh_flags == MESH_FLAGS_AE_A5_A6) {
skb_copy_bits(skb, hdrlen +
offsetof(struct ieee80211s_hdr, eaddr1),
tmp.h_dest, 2 * ETH_ALEN);
Expand All @@ -487,9 +489,9 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
ether_addr_equal(tmp.h_source, addr)))
return -1;
if (iftype == NL80211_IFTYPE_MESH_POINT) {
if (mesh_flags & MESH_FLAGS_AE_A5_A6)
if (mesh_flags == MESH_FLAGS_AE_A5_A6)
return -1;
if (mesh_flags & MESH_FLAGS_AE_A4)
if (mesh_flags == MESH_FLAGS_AE_A4)
skb_copy_bits(skb, hdrlen +
offsetof(struct ieee80211s_hdr, eaddr1),
tmp.h_source, ETH_ALEN);
Expand Down

0 comments on commit 029c581

Please sign in to comment.